简体   繁体   English

Xamarin iOS应用程序仅在通过TestFlight打开时崩溃

[英]Xamarin iOS app only crashes when opened through TestFlight

I'm facing a strange error. 我面临一个奇怪的错误。 The app works perfectly fine in Debug and Ad-Hoc etc. When I upload the app to TestFlight, it crashes when you download the app and hit 'Open'. 该应用程序在Debug和Ad-Hoc等中运行良好。当我将应用程序上载到TestFlight时,当您下载该应用程序并单击“打开”时,它会崩溃。 The weird thing is that if you open the app just through the OS, everything works as expected. 奇怪的是,如果仅通过操作系统打开应用程序,一切都会按预期进行。 I've done a lot of digging around and suspect it may be something to do with the FinishedLaunching Event and my check for the RemoteNotificationKey...but I really can't be sure. 我已经做了很多挖掘工作,怀疑可能与FinishedLaunching事件和我对RemoteNotificationKey的检查有关……但是我确实不确定。 Do I need a special condition for handling the launch through TestFlight? 我是否需要特殊条件才能通过TestFlight处理启动?

I've symbolicated the crash log and pasted it below (just the first section which seems relevant). 我已将崩溃日志符号化并粘贴到下面(只是第一部分似乎很重要)。 Any help would be greatly appreciated. 任何帮助将不胜感激。

Date/Time: 2017-03-06 22:45:00.8870 -0500
Launch Time: 2017-03-06 22:45:00.0333 -0500
OS Version: iPhone OS 10.0.2 (14A456)
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_a07 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018f892014 pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018f959460 pthread_kill + 112
2 libsystem_c.dylib 0x000000018f8063f4 abort + 140
3 GlobalMeetiOS 0x00000001007e15fc mono_handle_native_sigsegv (mini-exceptions.c:2420)
4 libsystem_platform.dylib 0x000000018f953348 _sigtramp + 52
5 libsystem_pthread.dylib 0x000000018f959460 pthread_kill + 112
6 libsystem_c.dylib 0x000000018f8063f4 abort + 140
7 GlobalMeetiOS 0x00000001008c9530 print_all_exceptions(MonoObject*) (runtime.m:997)
8 GlobalMeetiOS 0x00000001007e1d34 mono_invoke_unhandled_exception_hook (mini-exceptions.c:2873)
9 GlobalMeetiOS 0x00000001007e1290 mono_handle_exception_internal (mini-exceptions.c:1798)
10 GlobalMeetiOS 0x00000001007e0370 mono_handle_exception (mini-exceptions.c:2027)
11 GlobalMeetiOS 0x00000001007d8e6c mono_arm_throw_exception (exceptions-arm64.c:390)
12 GlobalMeetiOS 0x0000000100b6d7e8 throw_exception + 168
13 GlobalMeetiOS 0x0000000101469940 Xamarin_Forms_Platform_iOS_Xamarin_Forms_Platform_iOS_FormsApplicationDelegate_OnActivated_UIKit_UIApplication + 0
14 GlobalMeetiOS 0x00000001008ced50 GlobalMeetiOS_GlobalMeet_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary + 412
15 GlobalMeetiOS 0x0000000100b4eb64 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
16 GlobalMeetiOS 0x00000001007ee290 mono_jit_runtime_invoke (mini-runtime.c:2524)
17 GlobalMeetiOS 0x000000010084a524 do_runtime_invoke (object.c:2809)
18 GlobalMeetiOS 0x000000010084a480 mono_runtime_invoke (object.c:2967)
19 GlobalMeetiOS 0x00000001019e17b4 native_to_managed_trampoline_6(objc_object*, objc_selector*, _MonoMethod**, UIApplication*, NSDictionary*, char const*, char const*, char const*, char const*) (registrar.m:250)
20 GlobalMeetiOS 0x00000001019e1f4c -[AppDelegate application:didFinishLaunchingWithOptions:] (registrar.m:6765)
21 UIKit 0x000000019677f42c -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400
22 UIKit 0x000000019698fb70 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3524
23 UIKit 0x00000001969958e0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1656
24 UIKit 0x00000001969aa080 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3134 + 48
25 UIKit 0x00000001969928c4 -[UIApplication workspaceDidEndTransaction:] + 168
26 FrontBoardServices 0x00000001924658bc __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 36
27 FrontBoardServices 0x0000000192465728 -[FBSSerialQueue _performNext] + 176
28 FrontBoardServices 0x0000000192465ad0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
29 CoreFoundation 0x0000000190872278 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
30 CoreFoundation 0x0000000190871bc0 CFRunLoopDoSources0 + 524
31 CoreFoundation 0x000000019086f7c0 __CFRunLoopRun + 804
32 CoreFoundation 0x000000019079e048 CFRunLoopRunSpecific + 444
33 UIKit 0x00000001967785dc -[UIApplication _run] + 608
34 UIKit 0x0000000196773360 UIApplicationMain + 208
35 GlobalMeetiOS 0x0000000100c5fae4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/:1)
36 GlobalMeetiOS 0x0000000100be433c Xamarin_iOS_UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
37 GlobalMeetiOS 0x00000001008ceb98 GlobalMeetiOS_GlobalMeet_iOS_Application_Main_string + 28
38 GlobalMeetiOS 0x0000000100b4eb64 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
39 GlobalMeetiOS 0x00000001007ee290 mono_jit_runtime_invoke (mini-runtime.c:2524)
40 GlobalMeetiOS 0x000000010084a524 do_runtime_invoke (object.c:2809)
41 GlobalMeetiOS 0x000000010084c548 mono_runtime_exec_main (object.c:4585)
42 GlobalMeetiOS 0x000000010084c164 mono_runtime_run_main (object.c:4134)
43 GlobalMeetiOS 0x00000001007d868c mono_jit_exec (driver.g.c:1048)
44 GlobalMeetiOS 0x00000001008cd694 xamarin_main (monotouch-main.m:487)
45 GlobalMeetiOS 0x0000000101a02ef8 main (main.arm64.m:131)
46 libdyld.dylib 0x000000018f7805b8 start + 4

Thread 1:
0 libsystem_kernel.dylib 0x000000018f892a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018f95536c _pthread_wqthread + 1452
2 libsystem_pthread.dylib 0x000000018f954db4 start_wqthread + 4

Thread 2:
0 libsystem_kernel.dylib 0x000000018f892a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018f955188 _pthread_wqthread + 968
2 libsystem_pthread.dylib 0x000000018f954db4 start_wqthread + 4

Thread 3:
0 libsystem_pthread.dylib 0x000000018f954db0 start_wqthread + 0

I figured it out. 我想到了。 It turned out to be a problem with the launchOptions parameter in the FinishedLaunching event. 事实证明,FinishedLaunching事件中的launchOptions参数存在问题。 Again, strangely this only happened when opening the app from TestFlight. 再次,奇怪的是,这仅在从TestFlight打开应用程序时发生。 I guess after downloading the app and hitting the 'Open' button from TestFlight, it caused the launchOptions parameter to have some value. 我猜在下载应用程序并单击TestFlight中的“打开”按钮后,它导致launchOptions参数具有一定的价值。 However, this caused some strange behaviour in the rest of my code. 但是,这在我的其余代码中引起了一些奇怪的行为。

The code that specifically broke was the check to see whether launchOptions was null. 专门破坏的代码是检查launchOptions是否为null。 I was able to pinpoint the source of the crash and simply having -> if (launchOptions!=null) {...rest of code here...} was causing the crash. 我能够查明崩溃的源头,并且只需-> if(launchOptions!= null){...此处的其余代码...}导致崩溃。

I even took out all the code inside that code block and the app still crashed. 我什至取出了该代码块中的所有代码,该应用程序仍然崩溃。 Then, I removed the null check and the app no longer crashed on opening from TestFlight. 然后,我删除了空检查,并且该应用程序从TestFlight打开时不再崩溃。 Of course, now it would crash when simply opening it the regular way because I was checking launchOption keys without first explicitly making sure launchOptions wasn't null. 当然,现在只要按常规方式打开它,它就会崩溃,因为我在没有明确确保launchOptions不为null的情况下检查launchOption键。

If someone from Xamarin could explain this, it would be very helpful. 如果Xamarin的人可以解释这一点,那将非常有帮助。

The fix was to implement a way to handle exceptions thrown; 解决方法是实现一种处理引发的异常的方法。 this article helped me out with that: https://forums.xamarin.com/discussion/931/how-to-prevent-ios-crash-reporters-from-crashing-monotouch-apps 本文为我提供了帮助: https : //forums.xamarin.com/discussion/931/how-to-prevent-ios-crash-reporters-from-crashing-monotouch-apps

From the above example, I essentially wrapped the offending code inside that method mentioned ...and everything worked like a charm! 从上面的示例中,我实质上将令人反感的代码包装到了所提到的方法中……一切工作都像个魅力!

Hopefully, this will help someone else out struggling with the same issue. 希望这将帮助其他人为同一问题而苦苦挣扎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin.iOS 应用程序在 iOS13 上在 Testflight 上启动时崩溃 - Xamarin.iOS app crashes on startup on iOS13 on Testflight 从TestFlight打开应用时崩溃,否则可以正常工作 - App crashes when opened from TestFlight but works fine otherwise 如果通过 Xcode 安装,iOS 应用程序运行良好,但通过 TestFlight 安装时在一个特定的视图控制器上崩溃 - iOS app runs fine if installed through Xcode, but crashes on one particular view controller when installed through TestFlight 我的应用程序在 iOS 13+ 上的 Testflight 中崩溃 - My app Crashes in Testflight on iOS 13+ Only 应用程序仅在 Testflight 构建时崩溃 - App Crashes Only On Testflight Build 仅当通过Testflight安装时,应用程序才会解析JSON解析 - App crashes parsing JSON only when installed via Testflight React Native应用程序立即在iOS TestFlight上崩溃 - React Native app crashes immediately on iOS TestFlight 直接从iPhone打开时,iOS App崩溃并关闭 - iOS App crashes and closes when opened directly from the iPhone 在Fitbit授权期间通过url /打开iOS应用程序时崩溃 - iOS app crashes when opened by url/ during fitbit authorization uithread繁忙时打开附件文件时,iOS App崩溃 - IOS App crashes when attachement file is opened while uithread is busy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM