2017-03-07 1 views
0

Je suis confronté à une erreur étrange. L'application fonctionne parfaitement bien dans Debug et Ad-Hoc, etc. Lorsque je télécharge l'application sur TestFlight, elle se bloque lorsque vous téléchargez l'application et que vous cliquez sur "Ouvrir". La chose étrange est que si vous ouvrez l'application juste à travers le système d'exploitation, tout fonctionne comme prévu. J'ai fait beaucoup de recherches et je soupçonne que cela puisse avoir quelque chose à voir avec l'événement FinishedLaunching et ma vérification de RemoteNotificationKey ... mais je ne peux vraiment pas en être sûr. Ai-je besoin d'une condition spéciale pour gérer le lancement via TestFlight?L'application iOS Xamarin ne plante que lorsqu'elle est ouverte via TestFlight

J'ai symbolisé le journal des pannes et je l'ai collé ci-dessous (juste la première section qui semble pertinente). Toute aide serait grandement appréciée.

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 

Répondre

0

Je l'ai compris. Il s'est avéré être un problème avec le paramètre launchOptions dans l'événement FinishedLaunching. Encore une fois, étrangement, cela n'est arrivé que lors de l'ouverture de l'application depuis TestFlight. Je suppose qu'après avoir téléchargé l'application et appuyé sur le bouton 'Ouvrir' de TestFlight, le paramètre launchOptions a eu une certaine valeur. Cependant, cela a causé un comportement étrange dans le reste de mon code.

Le code qui a été spécifiquement cassé était la vérification pour voir si launchOptions était nul. J'ai été en mesure de localiser la source de l'accident et avoir simplement ->si (launchOptions! = Null) {... reste du code ici ...} était à l'origine du plantage.

J'ai même retiré tout le code à l'intérieur de ce bloc de code et l'application est toujours tombée en panne. Ensuite, j'ai supprimé la vérification null et l'application ne s'est plus écrasée lors de l'ouverture de TestFlight. Bien sûr, maintenant il se bloquerait en l'ouvrant simplement de la manière habituelle car je vérifiais les clés launchOption sans d'abord m'assurer explicitement que launchOptions n'était pas null.

Si quelqu'un de Xamarin pouvait expliquer cela, ce serait très utile.

Le correctif consistait à implémenter un moyen de gérer les exceptions levées; cet article m'a aidé à cela: https://forums.xamarin.com/discussion/931/how-to-prevent-ios-crash-reporters-from-crashing-monotouch-apps

Dans l'exemple ci-dessus, j'enveloppées essentiellement le code incriminé dans cette méthode mentionnée ... et tout a fonctionné comme un charme!

J'espère que cela aidera quelqu'un d'autre à se battre avec le même problème.