[SKStoreProductViewController sceneDisconnected:] crash on iOS 15.7

Hello.

We are experiencing come crashes on iOS 15.7 (both beta and release version). Our crashes are spiking with the release of iOS 15.7.

This issue happened before on iOS 15.6 beta but on 15.6 release it was fixed.

Here is the stack trace:

NSInvalidArgumentException ___CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__

NSInvalidArgumentException: -[SKStoreProductViewController sceneDisconnected:]: unrecognized selector sent to instance 0x10bb15e00

0  CoreFoundation     ___exceptionPreprocess
1  libobjc.A.dylib    _objc_exception_throw
2  CoreFoundation     -[NSObject(NSObject) doesNotRecognizeSelector:]
3  UIKitCore          -[UIResponder doesNotRecognizeSelector:]
4  CoreFoundation     ____forwarding___
5  CoreFoundation     ___forwarding_prep_0___
6  CoreFoundation     ___CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
7  CoreFoundation     ____CFXRegistrationPost_block_invoke
8  CoreFoundation     __CFXRegistrationPost
9  CoreFoundation     __CFXNotificationPost
10 Foundation         -[NSNotificationCenter postNotificationName:object:userInfo:]
11 UIKitCore          -[UIScene _invalidate]
12 UIKitCore          -[UIWindowScene _invalidate]
13 UIKitCore          -[UIApplication workspace:willDestroyScene:withTransitionContext:completion:]
14 UIKitCore          -[UIApplicationSceneClientAgent scene:willInvalidateWithEvent:completion:]
15 FrontBoardServices -[FBSScene _callOutQueue_agent_willDestroyWithTransitionContext:completion:]
16 FrontBoardServices ___84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke_2
17 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
18 FrontBoardServices ___84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke
19 libdispatch.dylib  __dispatch_client_callout
20 libdispatch.dylib  __dispatch_block_invoke_direct$VARIANT$mp
21 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
22 FrontBoardServices -[FBSSerialQueue _targetQueue_performNextIfPossible]
23 FrontBoardServices -[FBSSerialQueue _performNextFromRunLoopSource]
24 CoreFoundation     ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
25 CoreFoundation     ___CFRunLoopDoSource0
26 CoreFoundation     ___CFRunLoopDoSources0
27 CoreFoundation     ___CFRunLoopRun
28 CoreFoundation     _CFRunLoopRunSpecific
29 GraphicsServices   _GSEventRunModal
30 UIKitCore          -[UIApplication _run]
31 UIKitCore          _UIApplicationMain
32 XXXXXXXXXXX        main (main.m:8:22)
33 dyld               start

Regards!

Answered by Frameworks Engineer in 729646022

Thanks everyone for reporting an increased number of crash reports for an unrecognized selector in [SKStoreProductViewController sceneDisconnected:] or [SKStoreProductViewController appWillTerminate].

This crash happens in the public release of iOS/iPadOS 15.7, and seed releases of iOS/iPadOS 16 prior to seed 4 [1]. It does not occur in the public release of iOS 16.

The crash primarily happens when the app is in the background and is about to be terminated by the operating system. As a result, these crashes are not expected to be visible to the majority of end users. (One exception is on iPad with an app that supports multiple scenes, and a user manually terminates a scene.)

Your analytics will show an increased in crash rate, however your customers should not be affected by this issue. 

We are actively working to address the crash.

[1] In which case you should update to the most recent release.

Have the same issue

the same one is for iOS 15.7.0 and iOS 16.0.0 based on analytics.

The same issue. Huge amount of crashes.

Same issue in iOS 15.7. We originally saw the issue in 15.6 and 16.0 betas, but it was fixed. Disappointing that there is this regression in 15.7.

Our crashes are also spiking.

Crashes are spiking for us for 15.7 and 16.0 as well

Same issue on my application, seeing the crash numbers increase with users adopting iOS 16, sharing a link to stackoverflow on this matter

https://stackoverflow.com/questions/72907240/skstoreproductviewcontroller-crashes-for-unrecognized-selector-named-scenediscon

I have the same issue. I don't know why Apple don't solve the issue.

Has this been observed to crash the app while it’s active in the foreground?

Hello. I've managed to reproduce the issue.

It seems that the crash occurs when the user kills the app while a SKStoreProductViewController is being presented.

It does not crash when the controller is presented or when the controller is closed. Only when the user kills the app while the controller is on screen.

I've reproduced this issue on a sample project and on our AppStore App.

The same issue on iOS 15.7

We are having the same issue. Up until now it was still happening quite a lot on iOS 16, but yesterday the crashes spiked 10 times when they started appearing on iOS 15.7 and will probably continue to rise substantially now that iOS 15.7 and iOS 16 are officially out

Same here with 15.7, many user blame us because an app update same time with 15.7

Crash rates are of the charts, this issue dropped our crash-free sessions by 0.5%!!!! Apple please help!!!

Same issues: crashs mostly doubled for iOS 15.7 and iOS 16.0 (already happened on iOS 15.6 beta this summer).

[SKStoreProductViewController sceneDisconnected:] crash on iOS 15.7
 
 
Q