[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.

We also have this crash, also occurs in the release of iOS 16.

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

The same issue. Numbers of crashes increased 5x times (iOS 15.7/16.0). I assume, it will be more while iOS will be roll outed.

It's curious, we do not have this issue on iOS16 release.

Let me explain. We had this issue on iOS16 but when it was on beta. After the release of iOS16 we are not seeing a spike on that version, despite that our users are adopting iOS16. We still have crashes but those must be on beta versions.

But on iOS 15.7 release our crashes are spiking without any doubt.

We are also seeing this issue on iOS 15.7. Certainly also saw it on iOS 16 beta, not sure about the latest version.

Does anyone have an idea what that notification is that is being posted?

i have same issue 

The same issue on iOS 15.7. Crash rate has increased significantly.

We are investigating, thank you for the posts.

The same issue on iOS 15.7. Crash doubled

I am having the same issue, and the number of crashes are increasing, @ Apple please fix the bug as soon as possible

we are facing the same issues significantly on iOS15.7 and iOS 16; Crash rate is increasing

I am having the same issue, and the number of crashes are increasing, @ Apple please fix the bug as soon as possible

import StoreKit import UIKit

class ViewController: UIViewController {

  override func viewDidLoad() {     super.viewDidLoad()

    let storeKitViewController = SKStoreProductViewController()     storeKitViewController.loadProduct(withParameters: [       SKStoreProductParameterITunesItemIdentifier: NSNumber(integerLiteral: 364709193)     ])     present(storeKitViewController, animated: true)   } }

// Force quit after presentation to trigger crash // -[SKStoreProductViewController sceneDisconnected:]: unrecognized selector sent to instance // The good thing is that the user doesn't feel the crash

The same issue. Numbers of crashes increased (iOS 15.7/16.0). Any news @ Apple ?

I'm having the same issue in iOS 15.7.

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.

[SKStoreProductViewController sceneDisconnected:] crash on iOS 15.7
 
 
Q