Quick Action shortcut crashing if the app is launched from inactive state.

Quick Action is not working in a swift project when launched from inactive state. It works fine if the application is in background. FYI - I have not implemented the scene delegate.

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x1e6746200 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1f69831ac pthread_kill + 268 2 libsystem_c.dylib 0x1b153dca0 abort + 180 3 libswiftCore.dylib 0x1a42d8304 swift::fatalErrorv(unsigned int, char const*, char*) + 136 4 libswiftCore.dylib 0x1a42d8324 swift::fatalError(unsigned int, char const*, ...) + 32 5 libswiftCore.dylib 0x1a42cdc80 swift::swift_dynamicCastFailure(void const*, char const*, void const*, char const*, char const*) + 80 6 libswiftCore.dylib 0x1a42cdcfc swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, char const*) + 124 7 libswiftCore.dylib 0x1a42d25b4 swift_dynamicCast + 344 8 CI 0x104670a7c Dictionary.object(forKey:) + 268 9 CI 0x10467f98c AppDelegate.application(:didFinishLaunchingWithOptions:) + 328 10 CI 0x104681018 @objc AppDelegate.application(:didFinishLaunchingWithOptions:) + 188 11 UIKitCore 0x1ac53cf40 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300 12 UIKitCore 0x1ac53c664 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2848 13 UIKitCore 0x1ac53b640 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856 14 UIKitCore 0x1ac53b28c -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 132 15 UIKitCore 0x1ac280d64 _UIScenePerformActionsWithLifecycleActionMask + 108 16 UIKitCore 0x1ac5c2c3c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 17 UIKitCore 0x1ac473888 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220 18 UIKitCore 0x1ac4736b0 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 19 UIKitCore 0x1ac473260 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 20 UIKitCore 0x1ac47312c __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148 21 UIKitCore 0x1acb515a0 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 22 UIKitCore 0x1acbe996c _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 23 UIKitCore 0x1ac31f2d8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 24 UIKitCore 0x1ac791048 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.215 + 556 25 UIKitCore 0x1ac3f1bec -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 26 UIKitCore 0x1ac3f1a5c -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 27 UIKitCore 0x1ac3f0fb0 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 520 28 UIKitCore 0x1ac3f0d3c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288 29 FrontBoardServices 0x1bf9c9d48 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 344 30 FrontBoardServices 0x1bfa09104 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.78 + 120 31 FrontBoardServices 0x1bf9cdae4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 32 FrontBoardServices 0x1bfa08d3c __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 360 33 libdispatch.dylib 0x1b14d9fdc _dispatch_client_callout + 20 34 libdispatch.dylib 0x1b14dda5c _dispatch_block_invoke_direct + 264 35 FrontBoardServices 0x1bf9d7f2c FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52 36 FrontBoardServices 0x1bf9d7ac8 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 37 FrontBoardServices 0x1bf9da2a8 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 38 CoreFoundation 0x1aa12a22c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 39 CoreFoundation 0x1aa136614 __CFRunLoopDoSource0 + 176 40 CoreFoundation 0x1aa0ba57c __CFRunLoopDoSources0 + 340 41 CoreFoundation 0x1aa0cfeb8 __CFRunLoopRun + 836 42 CoreFoundation 0x1aa0d51e4 CFRunLoopRunSpecific + 612 43 GraphicsServices 0x1e2ef5368 GSEventRunModal + 164 44 UIKitCore 0x1ac584d88 -[UIApplication _run] + 888 45 UIKitCore 0x1ac5849ec UIApplicationMain + 340 46 CI 0x1045db234 main + 132 47 dyld 0x1c83f9948 start + 2504

It got resolved, issue was with the nil check.

Quick Action shortcut crashing if the app is launched from inactive state.
 
 
Q