Peter
Peter

Reputation: 11890

Xamarin iOS app crashes as soon as it is launched

Windows environment:

Visual Studio 2015    
Xamarin   4.4.0.34
Xamarin.Android   7.2.0.7
Xamarin.iOS   10.8.0.174 

Mac environment:

Xamarin Studio 6.3
Xcode 8.3.2
Xamarin.iOS 10.8.0.175

Our Xamarin app used to work fine on iOS. However, after applying the latest Xamarin updates (on Windows and Mac), the app crashes on iOS right after it starts.

Here is what I see in Visual Studio output window:

Launching 'MyApp.iOS' on 'Peter's iPad'...
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/Mono.Dynamic.Interpreter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.Core.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/Xamarin.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/Xamarin.Forms.Platform.dll
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/Xamarin.Forms.Core.dll
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.Net.Http.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.ServiceModel.Internals.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/System.Runtime.Serialization.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/A2B70246-8D92-4027-941A-B1A17589A251/MyAppiOS.app/.monotouch-64/Xamarin.Forms.Platform.iOS.dll [External]
2017-04-25 09:38:02.688 MyAppiOS[286:72426] error: Failed to load AOT module 'MyAppiOS' while running in aot-only mode: doesn't match assembly.
2017-04-25 09:38:02.689 MyAppiOS[286:72426] critical: Stacktrace:

2017-04-25 09:38:02.689 MyAppiOS[286:72426] critical: 
Native stacktrace:
2017-04-25 09:38:02.780 MyAppiOS[286:72426] critical:   0   MyAppiOS                          0x00000001002b5f24 mono_handle_native_sigsegv + 256
2017-04-25 09:38:02.780 MyAppiOS[286:72426] critical:   1   libsystem_platform.dylib            0x000000018c8d931c _sigtramp + 52
2017-04-25 09:38:02.780 MyAppiOS[286:72426] critical:   2   libsystem_pthread.dylib             0x000000018c8df334 pthread_kill + 112
2017-04-25 09:38:02.780 MyAppiOS[286:72426] critical:   3   libsystem_c.dylib                   0x000000018c7899c4 abort + 140
2017-04-25 09:38:02.780 MyAppiOS[286:72426] critical:   4   MyAppiOS                          0x00000001003ea3c8 _ZL12log_callbackPKcS0_S0_iPv + 76
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   5   MyAppiOS                          0x00000001003cb238 monoeg_g_log + 112
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   6   MyAppiOS                          0x0000000100280aa8 load_aot_module + 1296
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   7   MyAppiOS                          0x00000001002d4408 mono_assembly_load_from_full + 1060
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critica
l:  8   MyAppiOS                          0x00000001002d3f6c mono_assembly_open_a_lot + 980
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   9   MyAppiOS                          0x00000001003e98a0 _Z21xamarin_open_assemblyPKc + 256
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   10  MyAppiOS                          0x00000001003e99fc xamarin_open_and_register + 28
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   11  MyAppiOS                          0x00000001003f6918 xamarin_main + 1856
2017-04-25 09:38:02.781 MyAppiOS[286:72426] critical:   12  MyAppiOS                          0x00000001015d0f50 main + 96
2017-04-25 09:38:02.782 MyAppiOS[286:72426] critical:   13  libdyld.dylib                       0x000000018c70559c <redacted> + 4
2017-04-25 09:38:02.782 MyAppiOS[286:72426] critical: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the na
tive libraries 
used by your application.
=================================================================
The app has been terminated.
Launch succeeded. The app  'MyApp.iOS' has been successfully launched on 'Pradeep's iPad'.

And here is what I see in device log from Xcode:

OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Filtered syslog:
None found

Thread 0 name:  tid_403  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000018c815014 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000018c8df334 pthread_kill + 112
2   libsystem_c.dylib               0x000000018c7899c4 abort + 140
3   MyAppiOS                        0x0000000100236074 0x100018000 + 2220148
4   libsystem_platform.dylib        0x000000018c8d931c _sigtramp + 52
5   libsystem_pthread.dylib         0x000000018c8df334 pthread_kill + 112
6   libsystem_c.dylib               0x000000018c7899c4 abort + 140
7   MyAppiOS                        0x000000010036a3c8 0x100018000 + 3482568
8   MyAppiOS                        0x000000010034b238 0x100018000 + 3355192
9   MyAppiOS                        0x0000000100200aa8 0x100018000 + 2001576
10  MyAppiOS                        0x0000000100254408 0x100018000 + 2343944
11  MyAppiOS                        0x0000000100253f6c 0x100018000 + 2342764
12  MyAppiOS                        0x00000001003698a0 0x100018000 + 3479712
13  MyAppiOS                        0x00000001003699fc 0x100018000 + 3480060
14  MyAppiOS                        0x0000000100376918 0x100018000 + 3533080
15  MyAppiOS                        0x0000000101550f50 0x100018000 + 22253392
16  libdyld.dylib                   0x000000018c70559c start + 4

I am wondering if anyone has any idea on how to fix this. Any pointer will be appreciated. Regards.

Upvotes: 2

Views: 1715

Answers (1)

Sandoval
Sandoval

Reputation: 113

I've managed to solve this by updating all packages in my projects except Xamarin.Forms, which I kept in version 2.3.4.231 due to this bug [1]. After updating the packages, rebuilding all projects worked for me. If it doesn't work for you, try also deleting bin and obj folders before rebuilding again.

PS: When updating Xamarin.Forms, make sure it's the same version in all projects (shared, iOS and Android).

[1] https://forums.xamarin.com/discussion/95724/xamarin-forms-2-3-4-247-update-project-wont-build

Upvotes: 1

Related Questions