Xamarin iOS应用程序一启动就会崩溃

时间:2017-04-25 16:54:58

标签: xamarin.ios

Windows环境:

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

Mac环境:

Xamarin Studio 6.3
Xcode 8.3.2
Xamarin.iOS 10.8.0.175

我们的Xamarin应用程序曾经在iOS上运行良好。但是,在应用最新的Xamarin更新(在Windows和Mac上)后,应用程序在启动后立即在iOS上崩溃。

以下是我在Visual Studio输出窗口中看到的内容:

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'.

以下是我在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

我想知道是否有人知道如何解决这个问题。任何指针将不胜感激。问候。

1 个答案:

答案 0 :(得分:1)

我已经设法通过更新我的项目中的所有包来解决这个问题,除了Xamarin.Forms,由于这个错误[1]我保留在版本2.3.4.231中。更新软件包后,重建所有项目对我有用。如果它不适合您,请尝试在重建之前删除bin和obj文件夹。

PS:更新Xamarin.Forms时,请确保它在所有项目(共享,iOS和Android)中都是相同的版本。

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