We’ve been encountering a crash on iOS for the past 2-3 releases. Unfortunately, we haven’t been able to reproduce it locally, but Crashlytics reports it consistently.
The game has ads and I assume the crash happens during startup or after an interstitial ad is displayed.
Unity Version: 2022.3.53f1
iOS Version(s): iOS 18.1.1
Stacktrace:
Fatal Exception: NSInternalInconsistencyException
Attempting to attach window to an invalidated scene: <UIWindowScene: 0x1011c0c00; role: UIWindowSceneSessionRoleApplication; persistentIdentifier: 717200CE-1E33-41BF-B767-EECA0FFD3BE3; activationState: UISceneActivationStateUnattached>; window: <ASOOverlayWindow: 0x14afb7400; baseClass = UIApplicationRotationFollowingWindow; frame = (0 0; 375 812); hidden = YES; layer = <UIWindowLayer: 0x302b6f900>>
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x827cc __exceptionPreprocess
1 libobjc.A.dylib 0x172e4 objc_exception_throw
2 Foundation 0x80f8d8 _userInfoForFileAndLine
3 UIKitCore 0x362958 -[UIWindowScene _attachWindow:]
4 UIKitCore 0x3625b4 -[UIWindow _commonInitDebugName:uiScene:]
5 UIKitCore 0x3624a0 -[UIWindow _initWithFrame:debugName:windowScene:]
6 UIKitCore 0x2ccaf0 -[UIApplicationRotationFollowingWindow _initWithFrame:debugName:windowScene:]
7 UIKitCore 0x2cc8e4 -[UIWindow initWithWindowScene:]
8 UIKitCore 0xd1a34c -[UIApplicationRotationFollowingWindow initWithWindowScene:]
9 AppStoreOverlays 0x5778 -[ASOOverlayWindow initWithWindowScene:]
10 AppStoreOverlays 0x302c -[ASOOverlayManager initWithWindowScene:]
11 AppStoreOverlays 0x37e0 -[UIWindowScene(AppOverlayManager) _aso_appOverlayManager]
12 StoreKit 0x45fd8 +[SKOverlay dismissOverlayInScene:]
13 UnityFramework 0x2a9faf0 AdPresenter.cleanUp()
14 UnityFramework 0x2a9f7cc AdPresenter.triggerAdClose()
15 UnityFramework 0x2b140bc FullScreenVC.viewWillDisappear(_:)
16 UnityFramework 0x2b140fc @objc FullScreenVC.viewWillDisappear(_:)
17 UIKitCore 0xe4370 -[UIViewController _setViewAppearState:isAnimating:]
18 UIKitCore 0x28f604 -[UIViewController __viewWillDisappear:]
19 UIKitCore 0xa67268 __77-[UIPresentationController runTransitionForCurrentStateAnimated:handoffData:]_block_invoke_3
20 UIKitCore 0x28f74c +[UIPresentationController _scheduleTransition:]
21 UIKitCore 0xa66d18 -[UIPresentationController runTransitionForCurrentStateAnimated:handoffData:]
22 UIKitCore 0xa65248 -[UIPresentationController _dismissWithAnimationController:interactionController:animated:handoffData:]
23 UIKitCore 0x7ff30 +[UIView(Animation) performWithoutAnimation:]
24 UIKitCore 0xb0e81c __73-[UIViewController _dismissViewControllerWithTransition:from:completion:]_block_invoke
25 UIKitCore 0x7ff30 +[UIView(Animation) performWithoutAnimation:]
26 UIKitCore 0xb0dd74 -[UIViewController _dismissViewControllerWithTransition:from:completion:]
27 UIKitCore 0x525b84 -[UIViewController dismissViewControllerWithTransition:completion:]
28 UIKitCore 0x525248 -[UIViewController _performCoordinatedPresentOrDismiss:animated:]
29 UIKitCore 0x525008 -[UIViewController dismissViewControllerAnimated:completion:]
30 UIKitCore 0x38c144 __68-[UIWindow _removeAllViewControllersFromWindowHierarchyFromDealloc:]_block_invoke
31 UIKitCore 0x38c0ac +[UIViewController _performWithoutDeferringTransitionsAllowingAnimation:actions:]
32 UIKitCore 0x38bdc4 -[UIWindow _removeAllViewControllersFromWindowHierarchyFromDealloc:]
33 UIKitCore 0x2150d0 -[UIWindow setRootViewController:]
34 UnityFramework 0x1dc16b0 UnityCleanupTrampoline + 174 (UnityAppController.mm:174)
35 UIKitCore 0x113fdcc -[UIApplication _terminateWithStatus:]
36 UIKitCore 0x17ef88 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]
37 UIKitCore 0x95f8f4 -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:]
38 UIKitCore 0x113b54c -[UIApplication workspaceShouldExit:withTransitionContext:]
39 FrontBoardServices 0x54f68 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke_2
40 FrontBoardServices 0x14c44 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
41 FrontBoardServices 0x54f08 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke
42 libdispatch.dylib 0x40d0 _dispatch_client_callout
43 libdispatch.dylib 0x7b14 _dispatch_block_invoke_direct
44 FrontBoardServices 0x16300 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
45 FrontBoardServices 0x16280 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible]
46 FrontBoardServices 0x16158 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource]
47 CoreFoundation 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
48 CoreFoundation 0x562bc __CFRunLoopDoSource0
49 CoreFoundation 0x53e24 __CFRunLoopDoSources0
50 CoreFoundation 0x52fbc __CFRunLoopRun
51 CoreFoundation 0x52830 CFRunLoopRunSpecific
52 GraphicsServices 0x11c4 GSEventRunModal
53 UIKitCore 0x3d2eb0 -[UIApplication _run]
54 UIKitCore 0x4815b4 UIApplicationMain
55 UnityFramework 0x1dc64f0 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 102 (main.mm:102)
56 WordBlocks 0x417c main + 28 (main.mm:28)
57 ??? 0x1ac836ec8 (Missing)
Crashed: com.google.firebase.crashlytics.ios.exception
SIGABRT ABORT 0x00000001d72151d4
Crashed: com.google.firebase.crashlytics.ios.exception
0 UnityFramework 0x1fdf8a8 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1 UnityFramework 0x1fdfc8c FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2 UnityFramework 0x1fd7664 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3 UnityFramework 0x1fd23ac __FIRCLSExceptionRecord_block_invoke + 240 (FIRCLSException.mm:240)
4 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
5 libdispatch.dylib 0x13750 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 UnityFramework 0x1fd1308 FIRCLSExceptionRecord + 242 (FIRCLSException.mm:242)
7 UnityFramework 0x1fd1e64 FIRCLSExceptionRecordNSException + 126 (FIRCLSException.mm:126)
8 UnityFramework 0x1fd0f10 FIRCLSTerminateHandler() + 407 (FIRCLSException.mm:407)
9 libc++abi.dylib 0x1287c std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x12820 std::terminate() + 108
11 libobjc.A.dylib 0x3f948 objc_terminate + 16
12 libdispatch.dylib 0x40e4 _dispatch_client_callout + 40
13 libdispatch.dylib 0x7b14 _dispatch_block_invoke_direct + 284
14 FrontBoardServices 0x16300 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52
15 FrontBoardServices 0x16280 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240
16 FrontBoardServices 0x16158 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28
17 CoreFoundation 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
18 CoreFoundation 0x562bc __CFRunLoopDoSource0 + 176
19 CoreFoundation 0x53e24 __CFRunLoopDoSources0 + 344
20 CoreFoundation 0x52fbc __CFRunLoopRun + 840
21 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
22 GraphicsServices 0x11c4 GSEventRunModal + 164
23 UIKitCore 0x3d2eb0 -[UIApplication _run] + 816
24 UIKitCore 0x4815b4 UIApplicationMain + 340
25 UnityFramework 0x1dc64f0 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 102 (main.mm:102)
26 WordBlocks 0x417c main + 28 (main.mm:28)
27 ??? 0x1ac836ec8 (Missing)
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x1688 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4d98 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4cb0 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4afc mach_msg + 24
4 CoreFoundation 0x53a84 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53130 __CFRunLoopRun + 1212
6 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
7 Foundation 0xb7500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8 Foundation 0xb7350 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9 UIKitCore 0x3e6358 -[UIEventFetcher threadMain] + 420
10 Foundation 0xc86c8 __NSThread__start__ + 724
11 libsystem_pthread.dylib 0x637c _pthread_start + 136
12 libsystem_pthread.dylib 0x1494 thread_start + 8
caulk::deferred_logger
0 libsystem_kernel.dylib 0x1604 semaphore_wait_trap + 8
1 caulk 0x4a0c caulk::semaphore::timed_wait(double) + 220
2 caulk 0x48c4 caulk::concurrent::details::worker_thread::run() + 36
3 caulk 0x480c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4 libsystem_pthread.dylib 0x637c _pthread_start + 136
5 libsystem_pthread.dylib 0x1494 thread_start + 8
caulk.messenger.shared:high
0 libsystem_kernel.dylib 0x1604 semaphore_wait_trap + 8
1 caulk 0x4a0c caulk::semaphore::timed_wait(double) + 220
2 caulk 0x48c4 caulk::concurrent::details::worker_thread::run() + 36
3 caulk 0x480c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4 libsystem_pthread.dylib 0x637c _pthread_start + 136
5 libsystem_pthread.dylib 0x1494 thread_start + 8
com.apple.CoreMotion.MotionThread
0 libsystem_kernel.dylib 0x1688 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4d98 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4cb0 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4afc mach_msg + 24
4 CoreFoundation 0x53a84 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53130 __CFRunLoopRun + 1212
6 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
7 CoreFoundation 0xbdcec CFRunLoopRun + 64
8 CoreMotion 0x10084 (Missing UUID ad76b51c2c19371888c6e6a9d73d5868)
9 libsystem_pthread.dylib 0x637c _pthread_start + 136
10 libsystem_pthread.dylib 0x1494 thread_start + 8
com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x1688 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4d98 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4cb0 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4afc mach_msg + 24
4 CoreFoundation 0x53a84 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53130 __CFRunLoopRun + 1212
6 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
7 CFNetwork 0xfdee0 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
8 Foundation 0xc86c8 __NSThread__start__ + 724
9 libsystem_pthread.dylib 0x637c _pthread_start + 136
10 libsystem_pthread.dylib 0x1494 thread_start + 8
com.google.firebase.crashlytics.MachExceptionServer
0 libsystem_kernel.dylib 0x1688 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4d98 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4cb0 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4afc mach_msg + 24
4 UnityFramework 0x1fd9db0 FIRCLSMachExceptionServer + 196 (FIRCLSMachException.c:196)
5 libsystem_pthread.dylib 0x637c _pthread_start + 136
6 libsystem_pthread.dylib 0x1494 thread_start + 8
JavaScriptCore libpas scavenger
0 libsystem_kernel.dylib 0x6f90 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x3a50 _pthread_cond_wait + 1204
2 JavaScriptCore 0x15a6ca4 scavenger_thread_main + 1512
3 libsystem_pthread.dylib 0x637c _pthread_start + 136
4 libsystem_pthread.dylib 0x1494 thread_start + 8
MTGSKImpDispatchManagerThreadThread
0 libsystem_kernel.dylib 0x1688 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4d98 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4cb0 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4afc mach_msg + 24
4 CoreFoundation 0x53a84 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53130 __CFRunLoopRun + 1212
6 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
7 Foundation 0xb7500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8 Foundation 0xb73d4 -[NSRunLoop(NSRunLoop) run] + 64
9 UnityFramework 0x24f5bf8 -[MTGSKImpDispatchManager networkRequestThreadEntryPoint:] + 63040
10 Foundation 0xc86c8 __NSThread__start__ + 724
11 libsystem_pthread.dylib 0x637c _pthread_start + 136
12 libsystem_pthread.dylib 0x1494 thread_start + 8
Thread
0 libsystem_pthread.dylib 0x1480 start_wqthread + 8845051006
com.apple.AppStoreOverlays.viewServiceLoader
0 libsystem_kernel.dylib 0x7ad0 __ulock_wait + 8
1 libdispatch.dylib 0x4ac0 _dlock_wait + 56
2 libdispatch.dylib 0x47bc _dispatch_wait_on_address + 140
3 libdispatch.dylib 0x4e90 _dispatch_group_wait_slow + 56
4 AppStoreOverlays 0x4474 __51-[ASOOverlayViewController loadViewServiceIfNeeded]_block_invoke + 164
5 libdispatch.dylib 0x2370 _dispatch_call_block_and_release + 32
6 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
7 libdispatch.dylib 0xb6d8 _dispatch_lane_serial_drain + 744
8 libdispatch.dylib 0xc214 _dispatch_lane_invoke + 432
9 libdispatch.dylib 0x17258 _dispatch_root_queue_drain_deferred_wlh + 288
10 libdispatch.dylib 0x16aa4 _dispatch_workloop_worker_thread + 540
11 libsystem_pthread.dylib 0x4c7c _pthread_wqthread + 288
12 libsystem_pthread.dylib 0x1488 start_wqthread + 8