Crash on iOS with 7.0.1 SDK

We have updated our SDK in our project to 7.0.1. So far, so good, however, we now have a crash when the device is rotated while in a meeting. It appears the react code is trying to tell our app that we have rotated, and sending that message to the AppDelegate Window object. However, we are using UIWindowScene instead. Here is the stack:

	0   CoreFoundation                      0x00000001078a57c8 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x0000000105419144 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001078b447c +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   UIKitCore                           0x00000001249afd74 -[UIResponder doesNotRecognizeSelector:] + 232
	4   CoreFoundation                      0x00000001078a9490 ___forwarding___ + 740
	5   CoreFoundation                      0x00000001078abb4c _CF_forwarding_prep_0 + 92
	6   JitsiMeetSDK                        0x000000010609b46c -[RCTDeviceInfo _interfaceOrientationDidChange] + 88
	7   JitsiMeetSDK                        0x000000010609b3f0 __46-[RCTDeviceInfo interfaceOrientationDidChange]_block_invoke + 28
	8   JitsiMeetSDK                        0x0000000106080c38 RCTExecuteOnMainQueue + 44
	9   JitsiMeetSDK                        0x000000010609b398 -[RCTDeviceInfo interfaceOrientationDidChange] + 100
	10  CoreFoundation                      0x00000001077db990 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140
	11  CoreFoundation                      0x00000001077db8b4 ___CFXRegistrationPost_block_invoke + 84
	12  CoreFoundation                      0x00000001077dadbc _CFXRegistrationPost + 404
	13  CoreFoundation                      0x00000001077da7c8 _CFXNotificationPost + 668
	14  Foundation                          0x000000010a9b0ae0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
	15  UIKitCore                           0x0000000124989478 -[UIApplication setStatusBarOrientation:fromOrientation:windowScene:animationParameters:updateBlock:] + 1376
	16  UIKitCore                           0x00000001249c36b8 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke + 272
	17  UIKitCore                           0x000000012432d09c __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 108
	18  UIKitCore                           0x0000000124e190c0 +[UIView _performBlockDelayingTriggeringResponderEvents:forScene:] + 168
	19  UIKitCore                           0x000000012432cf2c __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 136
	20  UIKitCore                           0x0000000124e16b6c +[UIView(UIViewAnimationWithBlocksPrivate) _modifyAnimationsWithPreferredFrameRateRange:updateReason:animations:] + 164
	21  UIKitCore                           0x0000000124e15ae0 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 500
	22  UIKitCore                           0x0000000124e15e28 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 44
	23  UIKitCore                           0x000000012432cd84 -[_UIWindowRotationAnimationController animateTransition:] + 448
	24  UIKitCore                           0x00000001249c0f44 -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 500
	25  UIKitCore                           0x00000001249c346c -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1092
	26  UIKitCore                           0x00000001249c38ac -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 320
	27  UIKitCore                           0x00000001249c01d4 -[UIWindow _internal_setRotatableViewOrientation:updateStatusBar:duration:force:] + 104
	28  UIKitCore                           0x00000001249c1f18 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 188
	29  UIKitCore                           0x00000001249c1c60 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 1016
	30  UIKitCore                           0x00000001240eae1c -[_UIScenefbsSceneBasedMetricsCalculator _updateMetricsOnWindows:animated:] + 1004
	31  UIKitCore                           0x0000000124bb59e4 -[UIWindowScene _computeMetricsForWindows:animated:] + 84
	32  UIKitCore                           0x0000000124bb514c __33-[UIWindowScene _computeMetrics:]_block_invoke + 100
	33  UIKitCore                           0x0000000124bb5280 -[UIWindowScene _computeMetricsAndForceDelegateCallback:withAction:] + 276
	34  UIKitCore                           0x0000000124bb50dc -[UIWindowScene _computeMetrics:] + 76
	35  UIKitCore                           0x0000000124e15ae0 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 500
	36  UIKitCore                           0x0000000124e15d0c +[UIView(UIViewAnimationWithBlocks) _animateWithDuration:delay:options:factory:animations:completion:] + 48
	37  UIKitCore                           0x00000001244c6e78 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 468
	38  UIKitCore                           0x00000001245c3750 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 196
	39  UIKitCore                           0x00000001240efbd0 -[_UIWindowSceneGeometrySettingsDiffAction _updateSceneGeometryWithSettingObserverContext:windowScene:transitionContext:] + 608
	40  UIKitCore                           0x00000001240ef8dc -[_UIWindowSceneGeometrySettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 1084
	41  UIKitCore                           0x0000000123f60d5c __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.189 + 552
	42  UIKitCore                           0x0000000123f5fb60 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 208
	43  UIKitCore                           0x0000000123f60a18 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220
	44  UIKitCore                           0x00000001244eccf4 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 308
	45  FrontBoardServices                  0x00000001110d4040 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 392
	46  FrontBoardServices                  0x00000001110fb7b0 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 116
	47  FrontBoardServices                  0x00000001110df350 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160
	48  FrontBoardServices                  0x00000001110fb704 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 308
	49  libdispatch.dylib                   0x000000010c8a1d5c _dispatch_client_callout + 16
	50  libdispatch.dylib                   0x000000010c8a5974 _dispatch_block_invoke_direct + 392
	51  FrontBoardServices                  0x000000011111944c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44
	52  FrontBoardServices                  0x0000000111119340 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
	53  FrontBoardServices                  0x0000000111119480 -[FBSSerialQueue _performNextFromRunLoopSource] + 24
	54  CoreFoundation                      0x000000010780a18c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
	55  CoreFoundation                      0x000000010780a0d4 __CFRunLoopDoSource0 + 172
	56  CoreFoundation                      0x0000000107809844 __CFRunLoopDoSources0 + 232
	57  CoreFoundation                      0x0000000107803eb0 __CFRunLoopRun + 756
	58  CoreFoundation                      0x00000001078037a4 CFRunLoopRunSpecific + 584
	59  GraphicsServices                    0x0000000110073c98 GSEventRunModal + 160
	60  UIKitCore                           0x000000012498237c -[UIApplication _run] + 868
	61  UIKitCore                           0x0000000124986374 UIApplicationMain + 124
	62  Sametime                            0x0000000102f4dd90 main + 64
	63  dyld                                0x0000000104e85fa0 start_sim + 20
	64  ???                                 0x0000000104f6908c 0x0 + 4378235020
	65  ???                                 0xae4d800000000000 0x0 + 12559835673294536704

How does your AppDelegate.h look like? Do you have a reference to the window like so? @property (nonatomic, strong) UIWindow *window;

We don’t have a reference to the window in our AppDelegate. We are using Scenes. The window reference is in our SceneDelegate

Well, you gave me an idea, so I now have a fix. I added a window var to my AppDelegate, then after the app launches, I access the window object from my SceneDelegate and assign that to my AppDelegate window. Crash fixed.

1 Like

Excellent! I think many libraries rely on that existing, including React Native, which is what was accessing it.