Bug 56542 - App crashes in Release
Summary: App crashes in Release
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 10.10 (d15-2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2017-05-17 05:47 UTC by Akash Kava
Modified: 2017-12-09 17:58 UTC (History)
5 users (show)

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

App store crash report (50.91 KB, text/plain)
2017-05-17 05:47 UTC, Akash Kava

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 for Bug 56542 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Akash Kava 2017-05-17 05:47:59 UTC
Created attachment 22219 [details]
App store crash report

I updated Xamarin to latest version from 10.8 to 10.10, now suddenly app is crashing only in release mode for app store submission. App works fine totally in debug mode. But in release mode it simply crashes with following crash report. I tried to symbolicate crash report and attached is the crash.

I have the app in my archives and let me know what I can upload to process it further, I checked files under obj folder but could not determine root cause.

0   libsystem_kernel.dylib        	0x0000000188311014 0x1882f2000 + 126996
1   libsystem_pthread.dylib       	0x00000001883db334 0x1883d6000 + 21300
2   libsystem_c.dylib             	0x00000001882859c4 0x188224000 + 399812
3   Audition800iOS                	0x00000001011e6958 mono_handle_native_crash (mini-exceptions.c:2560)
4   libsystem_platform.dylib      	0x00000001883d531c 0x1883cf000 + 25372
5   libsystem_pthread.dylib       	0x00000001883db334 0x1883d6000 + 21300
6   libsystem_c.dylib             	0x00000001882859c4 0x188224000 + 399812
7   Audition800iOS                	0x00000001012fb38c 0x100064000 + 19493772
8   Audition800iOS                	0x000000010130eb54 monoeg_g_log (goutput.c:125)
9   Audition800iOS                	0x00000001011b0ab0 load_aot_module (aot-runtime.c:2060)
10  Audition800iOS                	0x0000000101205d34 mono_assembly_load_from_full (assembly.c:2099)
11  Audition800iOS                	0x0000000101205894 mono_assembly_open_a_lot (assembly.c:1779)
12  Audition800iOS                	0x00000001013215ac assembly_preload_hook(_MonoAssemblyName*, char**, void*) (monotouch-main.m:137)
13  Audition800iOS                	0x000000010120795c mono_assembly_load_corlib (assembly.c:1478)
14  Audition800iOS                	0x0000000101227c80 mono_init_internal (domain.c:556)
15  Audition800iOS                	0x00000001011f3220 mini_init (mini-runtime.c:3680)
16  Audition800iOS                	0x00000001013212c8 xamarin_main (monotouch-main.m:425)
17  Audition800iOS                	0x000000010112f88c main (main.m:103)
18  libdyld.dylib                 	0x000000018820159c 0x1881fd000 + 17820
Comment 1 Rolf Bjarne Kvinge [MSFT] 2017-05-17 08:07:09 UTC
Can you try cleaning your solution and then rebuilding to see if that changes anything?

Also, can you share the broken .app (I assume you created an .ipa for app submission) with us (even if cleaning the solution works)?
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-05-17 12:08:32 UTC
Did cleaning the solution work?
Comment 4 Akash Kava 2017-05-17 12:15:25 UTC
Yes clearing solution did work.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2017-05-17 12:17:45 UTC
Thanks, I'll have a look at why our non-clean builds don't work properly.
Comment 6 Marco Burato 2017-05-31 09:04:04 UTC
I've just experienced the same issue.
Doing a "Clean <project>" or "Clean <solution>" in Visual Studio for Mac didn't help.
I've also observed that the rebuild was taking a relatively short time and steps were being skipped.

To fix it I had to manually delete the "bin" and "obj" folders and then rebuild.
My best guess is that some files were considered up-to-date when they actually had to be rebuilt.

So, the second problem is that doing a "Clean" from the IDE doesn't actually clean everything. We should never have to manually delete those folders to clean the build.
Comment 7 Marco Burato 2017-06-15 12:54:32 UTC
I think I've found a way to reproduce the build not working properly.
I'm not sure if it's also the cause of the App Store crash, but it's plausible.

Steps to reproduce on my machine:
1. Open VS for Mac
2. Work on a project running the code in the usual iPhone simulator, say iPhone 7
3. Verify that changes to the code are reflected in the app behaviour
4. Close the iPhone simulator
5. On VS for Mac, select a different iPhone simulator, say iPhone SE
6. Change the code
7. Run the code in the new simulator (you might be required to build the project first)
8. Observe that the change in step 6 is NOT reflected in the simulator

In other words, after changing the target iPhone Simulator, VS never builds the app for that new iPhone Simulator (or keeps running the last build?).

As I mentioned in the previous comment, cleaning/rebuilding the project/solution doesn't help.
Restarting VS fixes the issue. I don't actually need to manually delete the bin/obj folders.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2017-06-15 16:44:33 UTC
@Marco, if cleaning the solution doesn't work for you, then your problem is different from the problem reported here (which was fixed by cleaning the solution, as explained in comment #4). In this case it's best to file a separate bug, so that it can be tracked (and resolved) separately.