[_UISnapshotWindow actualSceneBounds]: unrecognized selector

Hi everyone,


Anyone else seeing crashes like this:


Fatal Exception: NSInvalidArgumentException. -[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance


Seems to be happening in low memory situations.


Any easy fix? Our app isn't using a huge amount of RAM.


Thanks

I am seeing exactly this issue on iOS 14.7.1 devices, 100% when in background

-[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance 0x106d7f280

keyboard_arrow_up
0
CoreFoundation
__exceptionPreprocess
1
libobjc.A.dylib
objc_exception_throw
arrow_right
2
CoreFoundation
-[NSOrderedSet initWithSet:copyItems:]
3
UIKitCore
-[UIResponder doesNotRecognizeSelector:]
4
CoreFoundation
___forwarding___
5
CoreFoundation
_CF_forwarding_prep_0
6
UIKitCore
-[UIUndoGestureInteraction didMoveToView:]
7
UIKitCore
_setInteractionView
8
UIKitCore
-[UIView(Dragging) addInteraction:]
9
UIKitCore
-[UIEditingOverlayViewController _addInteractions]
10
UIKitCore
-[UIViewController _setViewAppearState:isAnimating:]
11
UIKitCore
__52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke
12
CoreFoundation
__NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13
CoreFoundation
-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]
14
UIKitCore
-[UIViewController _setViewAppearState:isAnimating:]
15
UIKitCore
-[UIViewController __viewDidAppear:]
16
UIKitCore
__64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke
17
UIKitCore
-[UIViewController _executeAfterAppearanceBlock]
18
UIKitCore
_runAfterCACommitDeferredBlocks
19
UIKitCore
_cleanUpAfterCAFlushAndRunDeferredBlocks
20
UIKitCore
-[UIApplication _performSnapshotsWithAction:forScene:completion:]
21
UIKitCore
__98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_3
22
UIKitCore
__98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_2
23
UIKitCore
-[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:]
24
UIKitCore
-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]
25
UIKitCore
-[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:]
26
FrontBoardServices
-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]
27
FrontBoardServices
__94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2
28
FrontBoardServices
-[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
29
FrontBoardServices
__94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke
30
libdispatch.dylib
_dispatch_client_callout
31
libdispatch.dylib
_dispatch_block_invoke_direct
32
FrontBoardServices
__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
33
FrontBoardServices
-[FBSSerialQueue _targetQueue_performNextIfPossible]
34
FrontBoardServices
-[FBSSerialQueue _performNextFromRunLoopSource]
35
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
36
CoreFoundation
__CFRunLoopDoSource0
37
CoreFoundation
__CFRunLoopDoSources0
38
CoreFoundation
__CFRunLoopRun
39
CoreFoundation
CFRunLoopRunSpecific
40
GraphicsServices
GSEventRunModal
41
UIKitCore
-[UIApplication _run]
42
UIKitCore
UIApplicationMain
43
AppName
AppDelegate.swift - Line 23
main + 23
44
libdyld.dylib
start

Fatal Exception: NSInvalidArgumentException -[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance 0x115643710

0 CoreFoundation __exceptionPreprocess 1 libobjc.A.dylib objc_exception_throw 2 CoreFoundation -[NSOrderedSet initWithSet:copyItems:] 3 UIKitCore -[UIResponder doesNotRecognizeSelector:] 4 CoreFoundation forwarding 5 CoreFoundation _CF_forwarding_prep_0 6 UIKitCore -[UIUndoGestureInteraction didMoveToView:] 7 UIKitCore _setInteractionView 8 UIKitCore -[UIView(Dragging) addInteraction:] 9 UIKitCore -[UIEditingOverlayViewController _addInteractions] 10 UIKitCore -[UIViewController _setViewAppearState:isAnimating:] 11 UIKitCore __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke 12 CoreFoundation NSARRAY_IS_CALLING_OUT_TO_A_BLOCK 13 CoreFoundation -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] 14 UIKitCore -[UIViewController _setViewAppearState:isAnimating:] 15 UIKitCore __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke 16 UIKitCore -[UIViewController _executeAfterAppearanceBlock] 17 UIKitCore _runAfterCACommitDeferredBlocks 18 UIKitCore _cleanUpAfterCAFlushAndRunDeferredBlocks 19 UIKitCore _afterCACommitHandler 20 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION 21 CoreFoundation __CFRunLoopDoObservers 22 CoreFoundation __CFRunLoopRun 23 CoreFoundation CFRunLoopRunSpecific 24 GraphicsServices GSEventRunModal 25 UIKitCore UIApplicationMain 26 App_Name main.m - Line 7 main + 7 27 libdyld.dylib start

Hi everyone!

Anyone else seeing crashes like this: Fatal Exception: NSInvalidArgumentException. -[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance

I'm encountering a crash within 3-4 seconds of launching my iOS app specifically on devices running iOS 14. The crash log indicates an NSInvalidArgumentException with the following message:

`Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x129754 __exceptionPreprocess
1  libobjc.A.dylib                0x287a8 objc_exception_throw
2  CoreFoundation                 0x2cc3c -[NSOrderedSet initWithSet:copyItems:]
3  UIKitCore                      0xc01ea0 -[UIResponder doesNotRecognizeSelector:]
4  CoreFoundation                 0x12c2ac ___forwarding___
5  CoreFoundation                 0x12e5b0 _CF_forwarding_prep_0
6  UIKitCore                      0xa918cc -[UIUndoGestureInteraction didMoveToView:]
7  UIKitCore                      0x11099b4 _setInteractionView
8  UIKitCore                      0x11098bc -[UIView(Dragging) addInteraction:]
9  UIKitCore                      0xe9d678 -[UIEditingOverlayViewController _addInteractions]
10 UIKitCore                      0x4a73e4 -[UIViewController _setViewAppearState:isAnimating:]
11 UIKitCore                      0x4a7910 __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke
12 CoreFoundation                 0xa75bc __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation                 0x2410 -[__NSArrayI enumerateObjectsWithOptions:usingBlock:]
14 UIKitCore                      0x4a75ac -[UIViewController _setViewAppearState:isAnimating:]
15 UIKitCore                      0x4a7dc0 -[UIViewController __viewDidAppear:]
16 UIKitCore                      0x4a9964 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke
17 UIKitCore                      0x4a873c -[UIViewController _executeAfterAppearanceBlock]
18 UIKitCore                      0xbda7c4 _runAfterCACommitDeferredBlocks
19 UIKitCore                      0xbc903c _cleanUpAfterCAFlushAndRunDeferredBlocks
20 UIKitCore                      0xbfcf10 _afterCACommitHandler
21 CoreFoundation                 0xa25e0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
22 CoreFoundation                 0x9c704 __CFRunLoopDoObservers
23 CoreFoundation                 0x9ccb0 __CFRunLoopRun
24 CoreFoundation                 0x9c360 CFRunLoopRunSpecific
25 GraphicsServices               0x3734 GSEventRunModal
26 UIKitCore                      0xbca584 -[UIApplication _run]
27 UIKitCore                      0xbcfdf4 UIApplicationMain
28 JobLogic                       0x1d9ac4 main + 14 (main.m:14)
29 libdyld.dylib                  0x1cf8 start`

Here's what I've observed: The crash consistently occurs within 3-4 seconds of app launch on iOS 14 devices.

I'm seeking assistance with:

Understanding the Cause: Any insights into potential causes of this crash, particularly related to _[_UISnapshotWindow actualSceneBounds] and its interaction with iOS 14, would be greatly appreciated.

Replication Steps: If possible, guidance on how to reliably replicate the crash on a development device would be extremely helpful for debugging purposes.

Solutions: Any suggestions or known workarounds to address this specific crash or similar issues in iOS 14 would be invaluable.

[_UISnapshotWindow actualSceneBounds]: unrecognized selector
 
 
Q