Foundation - _NSKVONotifyingOriginalClassForIsa in tvos 15.2 and above

I reset the old player item(remove all observers also) and avplayercontroller then add a new avplayerviewcontroller instance and avplayer and player item on playing a new asset/stream etc. It works fine and no crash in tvos 14, 13 etc. But in tvos 15.2 and above i get the following stack trace.

Below are the details i could collect from firebase, please check if it could help you to infer the cause of the crash. Thanks!


Crashed: com.apple.main-thread
SIGSEGV 0x00000007f2e51110

Crashed: com.apple.main-thread
0 libobjc.A.dylib        0x7624 class_getMethodImplementation + 32
1 Foundation           0xa1f30 _NSKVONotifyingOriginalClassForIsa + 28
2 Foundation           0x9db38 _NSKeyValueObservationInfoGetObservances + 272
3 Foundation           0xa8c50 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 244
4 Foundation           0xa9540 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 68
5 Foundation           0xa2080 _NSSetObjectValueAndNotify + 284
6 AVKit             0xe6b8 -[AVInterstitialController dealloc] + 32
7 AVKit             0x356e4 -[AVPlayerControllerTVExtras .cxx_destruct] + 144
8 libobjc.A.dylib        0x7d68 object_cxxDestructFromClass(objc_object*, objc_class*) + 112
9 libobjc.A.dylib        0x1dad0 objc_destructInstance + 88
10 libobjc.A.dylib        0x24f90 _objc_rootDealloc + 52
11 libsystem_blocks.dylib     0x37f8 _Block_release + 184
12 libdispatch.dylib       0x4f84 _dispatch_client_callout + 16
13 libdispatch.dylib       0x12164 _dispatch_main_queue_callback_4CF + 916
14 CoreFoundation         0x7a698 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
15 CoreFoundation         0x74b18 __CFRunLoopRun + 2528
16 CoreFoundation         0x73bf4 CFRunLoopRunSpecific + 572
17 GraphicsServices        0x6afc GSEventRunModal + 160
18 UIKitCore           0xa9ccd0 -[UIApplication _run] + 1080
19 UIKitCore           0xaa20cc UIApplicationMain + 164
20 XXXXXXX          0xc474 (Missing UUID xxxxxxxxx…)
21 ???              0x1030e91d0 (Missing)

I'm helping (hopefully) mssaranya6‍@‍gmail.com in this thread.

I am also getting this crash. Same circumstances.

Starting up a video stream using AVPlayerViewController.

I also set up both a AVPlayerItem.status observer as well as a "timeControlStatus" observer.

Then when I change to a different stream, I remove the observers, stop the current stream using player.replaceCurrentItem(with:nil) - nil out properties holding on the playerItem & player properties.

Then start a new stream, creating all new playerItem (AVPlayerItem) & player (AVPlayer) objects.

Is there a known workaround or a way to prevent this crash? Am I doing something wrong? This current strategy has worked for years.

Getting reports from the customers about this crash.

We are receiving the same crash. Just because of this crasher our crash-free users went down from 99.5% to 95%

Any solution to this?

Foundation - _NSKVONotifyingOriginalClassForIsa in tvos 15.2 and above
 
 
Q