My Xamarin project runs a simple token identification check on launch, which is where I believe it is being held up. The odd part is that it only crashes after not being opened for an extended period of time, like after 24 hours. No error is shown and the crash isn't fatal as you can still see it running in the background, but it won't launch. Once this initial error occurs, and the app is removed from the background, it launches and runs fine. [I previously posted regarding a similar (possibly the same) issue][1], but when that occurred, it would result in a crash as well as a crash report. It stopped 'crashing' after changing the iOS linker settings. [The code executed at launch can also be seen in a code review thread.][2] I don't understand why this is happening, the token is definitely not expired because they are set to expire 14 days after issuing. I'm using Azure for all backend and the web API is an ASP.NET project hosted on a free testing web hosting plan.
Crashlog:
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Region Info: 0 is not in any region. Bytes before following region: 4336173056
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 000000010274c000-0000000102794000 [ 288K] r-x/r-x SM=COW ...co.Mobile.iOS
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001be530df0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001be450948 pthread_kill + 228 (pthread.c:1458)
2 libsystem_c.dylib 0x00000001be3dfc24 __abort + 116 (abort.c:147)
3 libsystem_c.dylib 0x00000001be3dfbb0 abort + 116 (abort.c:118)
4 Ecco.Mobile.iOS 0x0000000105209d8c xamarin_initialize.cold.1 + 0
5 Ecco.Mobile.iOS 0x00000001052014a8 xamarin_printf + 44782760 (runtime.m:2468)
6 Ecco.Mobile.iOS 0x0000000105118f80 mono_invoke_unhandled_exception_hook + 43831168 (exception.c:1299)
7 Ecco.Mobile.iOS 0x00000001050ba76c mono_handle_exception_internal + 43444076 (mini-exceptions.c:2783)
8 Ecco.Mobile.iOS 0x00000001050b9154 mono_handle_exception + 43438420 (mini-exceptions.c:3107)
9 Ecco.Mobile.iOS 0x00000001050b0478 mono_arm_throw_exception + 43402360 (exceptions-arm64.c:401)
10 Ecco.Mobile.iOS 0x0000000102ba7a7c throw_exception + 172
11 Ecco.Mobile.iOS 0x00000001029180fc System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44
12 Ecco.Mobile.iOS 0x000000010291f924 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__7_0_object + 84
13 Ecco.Mobile.iOS 0x0000000103880e3c Foundation_NSAsyncSynchronizationContextDispatcher_Apply + 18042428 (NSAction.cs:178)
14 Ecco.Mobile.iOS 0x0000000102b640f0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272
15 Ecco.Mobile.iOS 0x00000001050caab4 mono_jit_runtime_invoke + 43510452 (mini-runtime.c:3165)
16 Ecco.Mobile.iOS 0x0000000105163b9c mono_runtime_invoke_checked + 44137372 (object.c:3220)
17 Ecco.Mobile.iOS 0x0000000105167004 mono_runtime_invoke + 44150788 (object.c:3107)
18 Ecco.Mobile.iOS 0x0000000102754514 native_to_managed_trampoline_18(objc_object*, objc_selector*, _MonoMethod**, unsigned int) + 34068 (registrar.m:776)
19 Ecco.Mobile.iOS 0x0000000102755578 -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector] + 38264 (registrar.m:7896)
20 Foundation 0x00000001beb4ef94 __NSThreadPerformPerform + 188 (NSThread.m:807)
21 CoreFoundation 0x00000001be6c4d14 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
22 CoreFoundation 0x00000001be6c4c68 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
23 CoreFoundation 0x00000001be6c43c4 __CFRunLoopDoSources0 + 188 (CFRunLoop.c:1992)
24 CoreFoundation 0x00000001be6bf1fc __CFRunLoopRun + 780 (CFRunLoop.c:2882)
25 CoreFoundation 0x00000001be6bebc8 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
26 GraphicsServices 0x00000001c8aa05cc GSEventRunModal + 164 (GSEvent.c:2246)
27 UIKitCore 0x00000001c2871744 UIApplicationMain + 1936 (UIApplication.m:4823)
28 Ecco.Mobile.iOS 0x00000001038dfa98 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 344
29 Ecco.Mobile.iOS 0x000000010382a500 UIKit_UIApplication_Main_string___intptr_intptr + 17687808 (UIApplication.cs:86)
30 Ecco.Mobile.iOS 0x000000010382a484 UIKit_UIApplication_Main_string___string_string + 17687684 (UIApplication.cs:66)
31 Ecco.Mobile.iOS 0x0000000102796334 Ecco_Mobile_iOS_Application_Main_string__ + 303924 (/<unknown>:1)
32 Ecco.Mobile.iOS 0x0000000102b640f0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272
33 Ecco.Mobile.iOS 0x00000001050caab4 mono_jit_runtime_invoke + 43510452 (mini-runtime.c:3165)
34 Ecco.Mobile.iOS 0x0000000105163b9c mono_runtime_invoke_checked + 44137372 (object.c:3220)
35 Ecco.Mobile.iOS 0x0000000105168c94 mono_runtime_exec_main_checked + 44158100 (object.c:5284)
36 Ecco.Mobile.iOS 0x00000001050affe0 mono_jit_exec + 43401184 (driver.c:1328)
37 Ecco.Mobile.iOS 0x0000000105208238 xamarin_main + 44810808 (monotouch-main.m:0)
38 Ecco.Mobile.iOS 0x0000000102796290 main + 303760 (main.m:312)
39 libdyld.dylib 0x00000001be53b384 start + 4
Full stack trace: https://pastebin.com/VXHHdjdz
App Center Analytics
. And for me, i had the same issue but it maybe of different cause for you, i had an extra symbol present in my xaml file, so my app use to crash at startup in Release mode only, worked fine on Debug mode – Irisirisa