Hi I am trying to find why my app is crashing at launch in Test Flight. I have tested it many times in debugger and release environment but it does not crash.
Can any kind soul help me understanding why my app is crashing from the crash log?
OS Version: iPhone OS 14.5.1 (18E212)
Release Type: User
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 3
Application Specific Information:
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x19765b5b4 __exceptionPreprocess + 220
1 libobjc.A.dylib 0x1ac0da7a8 objc_exception_throw + 59
2 CoreFoundation 0x19755f6d4 -[NSException raise] + 15
3 CardScanner 0x100485c2c 0x1001d0000 + 2841644
4 CardScanner 0x100436e10 0x1001d0000 + 2518544
5 libdispatch.dylib 0x197246a54 _dispatch_call_block_and_release + 31
6 libdispatch.dylib 0x1972487ec _dispatch_client_callout + 19
7 libdispatch.dylib 0x19724b938 _dispatch_queue_override_invoke + 755
8 libdispatch.dylib 0x197259fb0 _dispatch_root_queue_drain + 387
9 libdispatch.dylib 0x19725a7a8 _dispatch_worker_thread2 + 111
10 libsystem_pthread.dylib 0x1e245a768 _pthread_wqthread + 215
11 libsystem_pthread.dylib 0x1e246174c start_wqthread + 7
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_malloc.dylib 0x00000001a6c45ed4 nanov2_allocate_from_block + 240
1 libsystem_malloc.dylib 0x00000001a6c450ac nanov2_allocate + 128
2 libsystem_malloc.dylib 0x00000001a6c450ac nanov2_allocate + 128
3 libsystem_malloc.dylib 0x00000001a6c456a8 nanov2_calloc + 152
4 libsystem_malloc.dylib 0x00000001a6c49ab0 _malloc_zone_calloc + 88
5 libobjc.A.dylib 0x00000001ac0bc100 realizeClassWithoutSwift+ 41216 (objc_class*, objc_class*) + 100
6 libobjc.A.dylib 0x00000001ac0bbf78 realizeClassMaybeSwiftMaybeRelock+ 40824 (objc_class*, mutex_tt&, bool) + 244
7 libobjc.A.dylib 0x00000001ac0cab08 lookUpImpOrForward + 884
8 libobjc.A.dylib 0x00000001ac0b4644 _objc_msgSend_uncached + 68
9 UIKitCore 0x0000000199b351f0 -[UIApplicationSceneSpecification initialActionHandlers] + 156
10 UIKitCore 0x00000001994c2458 +[UIScene _connectionOptionsForScene:withSpecification:transitionContext:actions:sceneSession:] + 188
11 UIKitCore 0x000000019a03e0c4 -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 460
12 UIKitCore 0x000000019a03e698 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 332
13 UIKitCore 0x0000000199b346ac -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388
14 FrontBoardServices 0x00000001a6bb75d8 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 440
15 FrontBoardServices 0x00000001a6be2d44 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.200 + 128
16 FrontBoardServices 0x00000001a6bc66a4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
17 FrontBoardServices 0x00000001a6be2a0c __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372
18 libdispatch.dylib 0x00000001972487ec _dispatch_client_callout + 20
19 libdispatch.dylib 0x000000019724c2dc _dispatch_block_invoke_direct + 268
20 FrontBoardServices 0x00000001a6c0afa0 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 48
21 FrontBoardServices 0x00000001a6c0ac30 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 448
22 FrontBoardServices 0x00000001a6c0b184 -[FBSSerialQueue _performNextFromRunLoopSource] + 32
23 CoreFoundation 0x00000001975d5848 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28
24 CoreFoundation 0x00000001975d5744 __CFRunLoopDoSource0 + 208
25 CoreFoundation 0x00000001975d4ab4 __CFRunLoopDoSources0 + 376
26 CoreFoundation 0x00000001975cea28 __CFRunLoopRun + 820
27 CoreFoundation 0x00000001975ce1c0 CFRunLoopRunSpecific + 600
28 GraphicsServices 0x00000001aebb6734 GSEventRunModal + 164
29 UIKitCore 0x000000019a03c7e4 -[UIApplication _run] + 1072
30 UIKitCore 0x000000019a042054 UIApplicationMain + 168
31 libswiftUIKit.dylib 0x00000001ab35424c UIApplicationMain+ 94796 (::::) + 104
32 CardScanner 0x00000001001ddfe8 0x1001d0000 + 57320
33 libdyld.dylib 0x000000019728acf8 start + 4
Thread 1:
0 libsystem_pthread.dylib 0x00000001e2461744 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x00000001e2461744 start_wqthread + 0
Thread 3 name: Dispatch queue: com.apple.root.default-qos
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00000001c4fb9334 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001e2459aa0 pthread_kill + 272
2 libsystem_c.dylib 0x00000001a09dbb90 abort + 104
3 libc++abi.dylib 0x00000001ac1bbbb8 __cxxabiv1::__aligned_malloc_with_fallback+ 80824 (unsigned long) + 0
4 libc++abi.dylib 0x00000001ac1acec8 demangling_unexpected_handler+ 20168 () + 0
5 libobjc.A.dylib 0x00000001ac0b905c _objc_terminate+ 28764 () + 144
6 libc++abi.dylib 0x00000001ac1bafa0 std::__terminate(void (*)+ 77728 ()) + 20
7 libc++abi.dylib 0x00000001ac1baf2c std::terminate+ 77612 () + 48
8 libdispatch.dylib 0x0000000197248800 _dispatch_client_callout + 40
9 libdispatch.dylib 0x000000019724b938 _dispatch_queue_override_invoke + 756
10 libdispatch.dylib 0x0000000197259fb0 _dispatch_root_queue_drain + 388
11 libdispatch.dylib 0x000000019725a7a8 _dispatch_worker_thread2 + 112
12 libsystem_pthread.dylib 0x00000001e245a768 _pthread_wqthread + 216
13 libsystem_pthread.dylib 0x00000001e246174c start_wqthread + 8
Thread 4:
0 libsystem_pthread.dylib 0x00000001e2461744 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x00000001e2461744 start_wqthread + 0
From the log I am guessing you app is called CardScanner, and the first step you should perform is getting the log 'symbolicated', it will be more apparent where the crash is occurring:
3 CardScanner 0x100485c2c 0x1001d0000 + 2841644
4 CardScanner 0x100436e10 0x1001d0000 + 2518544
When symbolicated, those numbers (0x100485c2c 0x1001d0000 + 2841644) will turn into method names, which will help. You should be able to symbolicate from Xcode -> Window -> Organiser and selecting Crashes, or on the device by selecting the device in Devices and Simulators, then view logs, then right click on your app name and selecting re-symbolicate
From the top of the log I can see that the thread that crashed was Thread 3:
Triggered by Thread: 3
So, check you're not updating the UI off that thread? (UI updates should be Dispatched onto main thread).
The exception is:
EXC_CRASH (SIGABRT)
So check there's not a nil somewhere that shouldn't be there, eg: inserting nil into an array or a dictionary, or setting something that is not an optional to nil ( or you've force unwrapped an optional using '!' )