Bug 16194 - Unexpected error when choosing Zip App Bundle.
Summary: Unexpected error when choosing Zip App Bundle.
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 7.0.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 7.0.6
Assignee: Bugzilla
URL:
: 16290 ()
Depends on:
Blocks:
 
Reported: 2013-11-13 10:25 UTC by David Breyer
Modified: 2014-01-30 05:15 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description David Breyer 2013-11-13 10:25:53 UTC
Description of Problem:

Every since updating Xamarin yesterday, the follow error occurs when I choose the Option - Zip App Bundle.

error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.InternalPInvoke.GetEntryPoints (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.StripNativeCode () [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.Build () [0x00000] in <filename unknown>:0 
  at MTouch.Main2 (System.String[] args) [0x00000] in <filename unknown>:0 
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Steps to reproduce the problem:
1. Click menu item Project
2. Click Zip App Bundle


Actual Results:

error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.InternalPInvoke.GetEntryPoints (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.StripNativeCode () [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.Build () [0x00000] in <filename unknown>:0 
  at MTouch.Main2 (System.String[] args) [0x00000] in <filename unknown>:0 
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0 


Expected Results:

I expect it to create the App Bundle.


How often does this happen? 

Every time I choose the option Zip App Bundle or Publish to Test Flight.  I have now tried this on two different machines, both with the same results.


Additional Information:
I can run the app in the simulator.
I can deploy the app to my devices in debug mode.
I can compile for Distribution without error.
But if I choose the Option Zip App Bundle the error occurs.
Comment 1 Mikayla Hutchinson [MSFT] 2013-11-13 11:05:12 UTC
What version of Xamarin.iOS?
Comment 2 David Breyer 2013-11-13 11:13:33 UTC
Xamarin Studio
Version 4.2 (build 2)
Installation UUID: 55a83a32-cbda-4b2b-9f13-80e6500c64fd
Runtime:
	Mono 3.2.4 ((no/294f999)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302040000

Apple Developer Tools
Xcode 5.0.2 (3335.32)
Build 5A3005

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.Android
Version: 4.8.3 (Starter Edition)
Android SDK: /Users/David/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Xamarin.iOS
Version: 7.0.4.209 (Starter Edition)
Hash: 23a0827
Branch: 
Build date: 2013-11-11 16:04:00-0500

Build Information
Release ID: 402000002
Git revision: a37a8e0cda771d222cabe1f9af29c4d586e7fc7d
Build date: 2013-11-11 22:38:26+0000
Xamarin addins: 2f88a112110098d5c6964bce4251c617c2e8a968

Operating System
Mac OS X 10.9.0
Darwin davids-mbp.ga.afginc.com 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-11-13 11:29:32 UTC
Can you zip up and attach [1] the contents of the obj/iPhone/*/mtouch-cache directory, as well as the complete build output when doing a *re*build (not only build)?

[1] You'll probably have to use dropbox or a similar service, since it'll be too big for an attachment.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2013-11-13 18:11:47 UTC
Sebastien, the MT3005+MT3006 warnings seems to be because System.Data.dll has a reference to Mono.Data.Tds.dll even after Mono.Data.Tds.dll was linked away.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2013-11-13 18:19:27 UTC
I can duplicate the System.NullReferenceException with 7.0.4, but not with master, which means we've fixed this bug already.
Comment 7 David Breyer 2013-11-13 19:45:32 UTC
There must be a misunderstanding. I don't care about the missing Mono.Data.Tds message. If I choose the menu option Project - Zip App Bundle (or even Publish to TestFlight) I get the following message.

Error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com (MT0000)

It does not create the App Bundle (or deploy to TestFlight).

Is there a fix for that?
Comment 8 David Breyer 2013-11-13 19:47:46 UTC
I feel I should note that this started after I installed the update yesterday. I previously had no problem building the App Bundle or Publishing to TestFlight. Which I did twice yesterday before installing the latest update.
Comment 9 Sebastien Pouliot 2013-11-13 20:26:11 UTC
@David,

> error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
> System.NullReferenceException: Object reference not set to an instance of an object

^ Rolf is saying the NRE (the root issue causing the reported MT0000 error) is gone in "master" - even if he confirmed it did exist in 7.0.4. That means the issue is already fixed (and will be be part of a future maintenance release).

If this is a blocking issue you should try to downgrade to the previous stable (7.0.2) until a newer version is released. You can download previous versions from the customer portal.


@Rolf, I'll have a look at it - I spotted a similar case in `mmp` (assemblies refs not updated, it could be due to recent changes wrt forwarders/PCL assemblies).
Comment 10 Rolf Bjarne Kvinge [MSFT] 2013-11-13 20:29:46 UTC
David, the MT3005+MT3006 warnings is still a bug, even if you don't care about
them. In any case I've filed a new bug (bug #16213) for that problem.

The fix for your problem will be included in the next non-hotfix release (at
this point I can't say when that will be, given that we've just released
7.0.4).

In any case it looks like there is a difference in the build when you're
creating the zipped app bundle (do you change to a different configuration when
you create it?). Making sure the zipped app bundle is built with exactly the
same configuration as the Distribution build should work around the problem on
your end.
Comment 11 David Breyer 2013-11-14 09:34:15 UTC
I use the exact same configuration for both Distribution build and Zip App Bundle build.  Both of them use the configuration named Distribution.

Would the fact that this solution/project is years old make a difference? This is project was created under MonoDevelop several years ago when Xamarin was MonoTouch. This is the first time I ever had issue with it.

In order to downgrade, do I just download Xamarin.IOS 7.0.2 and keep Xamarin Studio 2.4?  Or do I have to downgrade the Studio as well?  Does it require a reinstall or can I install the old version over top of my existing installation?
Comment 12 Rolf Bjarne Kvinge [MSFT] 2013-11-14 09:48:40 UTC
That's definitively strange, for in the build logs you sent, LLVM is enabled for the "zip app" build, while it's disabled for the "Distribution" build - did you change this between builds maybe?

You should be able to keep the current version of Xamarin Studio and just install any older versions of Xamarin.iOS (no need to uninstall, etc, just install on top of whatever you have right now).
Comment 13 David Breyer 2013-11-14 09:55:28 UTC
I did change the LLVM as another developer and I were trying to troubleshoot the problem. And we were grasping at straws. I ran the Zip App Bundle numerous times with it on and off, and all results in the same issue.

I will try installing the old version now. Thanks.
Comment 14 David Breyer 2013-11-14 10:10:52 UTC
I downgraded to 7.0.2 and now it works again. I guess I will stop blindingly downloading Xamarin updates. And just wait until I have to update.
Comment 15 PJ 2013-12-11 18:45:43 UTC
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
Comment 16 Prashant manu 2013-12-12 09:49:31 UTC
I have checked this issue with following build:

All Mac
X.S 4.2.2(build 2)
X.iOS 7.0.6-159
Mono 3.2.6
Xcode 5.0.2
Xcode 4.6.3
Xcode 5.1
Xcode 5.0

I am successfully able to zip app bundle and publish to test flight.

Changing the status to Verified.
Comment 17 Sebastien Pouliot 2013-12-12 10:25:27 UTC
*** Bug 16290 has been marked as a duplicate of this bug. ***
Comment 18 Tom Gilder 2014-01-29 06:41:36 UTC
I'm still having this exact problem occur with Xamarin.iOS 7.0.6.168 and Mono 3.2.6.

Cleaning before archiving fixes it, but otherwise I always get the exception.
Comment 19 Rolf Bjarne Kvinge [MSFT] 2014-01-29 10:26:25 UTC
@Tom Gilder, can you file a new bug and attach a test project we can use to reproduce your issue? It looks like your case might be different.
Comment 20 Tom Gilder 2014-01-30 05:15:24 UTC
Done: Bug 17506