Posts

Post not yet marked as solved
18 Replies
Update: SOLVED IT! We were accidentally doing navigation in the background, which was still happening when we called the completionHandler, which triggered a new snapshot, which crashes when navigation is in progress. Solution: inside application(_:, didReceiveRemoteNotification:, fetchCompletionHandler:), before doing any navigation, guard that case .inactive = application.applicationState, otherwise return. That worked for us!
Post not yet marked as solved
18 Replies
Update: resigning and restoring first responder did not resolve the issue (thought it does look much nicer with the privacy screen). Really desperate for a fix here.
Post not yet marked as solved
18 Replies
This has become our most common crash so I'm trying a workaround. My stack traces look similar and always seemed related to updating the snapshot of the keyboard due to a background fetch event. My intended solution is to resign first responder when going in to the background and restore it when coming back. I've never been able to reproduce the crash directly myself but I'll leave an update here in a couple weeks if that fixes it. One relatively unique thing about our app is we throw up a privacy cover when transitioning to the background to avoid showing private information on the switcher. Is anyone else who's seeing this crash doing that? Ideally we could disable the screenshot-updating behavior altogether, because the static view isn't ever going to look any different, but I don't see a way to do that. Fatal Exception: NSInvalidArgumentException[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance 0x10bde7db0 0	CoreFoundation								 0x194fcf180 __exceptionPreprocess 1	libobjc.A.dylib								0x1941a79f8 objc_exception_throw 2	CoreFoundation								 0x194eeb9bc -[NSOrderedSet initWithSet:copyItems:] 3	UIKitCore											0x1c17e8220 -[UIResponder doesNotRecognizeSelector:] 4	CoreFoundation								 0x194fd49c8 _forwarding_ 5	CoreFoundation								 0x194fd665c _CF_forwarding_prep_0 6	UIKitCore											0x1c15c8e88 -[UIInputWindowController _aligningInsetsForChildInputViewController:includeSceneBounds:] 7	UIKitCore											0x1c15c98b0 -[UIInputWindowController updateConstraintInsets] 8	UIKitCore											0x1c15cbd94 -[UIInputWindowController hostAppSceneBoundsChanged] 9	UIKitCore											0x1c1a94028 -[UITextEffectsWindow _updateTransformLayer] 10 UIKitCore											0x1c1a947f4 -[UITextEffectsWindow _willSnapshot] 11 UIKitCore											0x1c17c8770 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] 12 UIKitCore											0x1c17c96f0 -[UIApplication _saveSnapshotWithName:] 13 UIKitCore											0x1c17d4318 __125-[UIApplication _updateStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:updateSnapshot:canvas:]_block_invoke_2 14 libdispatch.dylib							0x194a0ca38 _dispatch_call_block_and_release 15 libdispatch.dylib							0x194a0d7d4 _dispatch_client_callout 16 libdispatch.dylib							0x1949bb008 _dispatch_main_queue_callback_4CF$VARIANT$mp 17 CoreFoundation								 0x194f60b20 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 18 CoreFoundation								 0x194f5ba58 __CFRunLoopRun 19 CoreFoundation								 0x194f5afb4 CFRunLoopRunSpecific 20 GraphicsServices							 0x19715c79c GSEventRunModal 21 UIKitCore											0x1c17bcc38 UIApplicationMain 22 Vida													 0x1005a9894 main + 12 (AppDelegate.swift:12) 23 libdyld.dylib									0x194a1e8e0 start