Flutter App Crashing in TestFlight but works on Simulator - ios

Been working on a flutter app. Everything is fine and we can debug on simulators and devices, both iOS and Android. Our Android app builds fine and the APK is up in the Play Store. The iOS app on the other hand doesn't like to be deployed via TestFlight. Building an archive, uploading to
AppStore distributing the app through TestFlight we see the app crash immediately on startup.
Incident Identifier: A2957531-E65F-4D12-8BBD-7E2F81D3E421
Hardware Model: iPhone13,2
Process: Runner [28250]
Path: /private/var/containers/Bundle/Application/81207991-AD48-47CF-838B-65B6A07B6739/Runner.app/Runner
Identifier: com.something.someapp
Version: 7 (1.5.1)
AppStoreTools: 12E262
AppVariant: 1:iPhone13,2:14
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.something.someapp[3642]
Date/Time: 2021-06-28 22:26:52.5039 +0300
Launch Time: 2021-06-28 22:26:52.3731 +0300
OS Version: iPhone OS 14.3 (18C66)
Release Type: User
Baseband Version: 1.31.03-5
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001b996c414 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001d73c6b40 pthread_kill + 272 (pthread.c:1388)
2 libsystem_c.dylib 0x0000000194f92b74 abort + 104 (abort.c:110)
3 Flutter 0x00000001039768e0 0x103698000 + 3008736
4 Flutter 0x0000000103976a10 0x103698000 + 3009040
5 Flutter 0x0000000103b6920c 0x103698000 + 5050892
6 Flutter 0x00000001039e5914 0x103698000 + 3463444
7 Flutter 0x00000001036a60ec 0x103698000 + 57580
8 Flutter 0x00000001036bb134 0x103698000 + 143668
9 Flutter 0x00000001036baf70 0x103698000 + 143216
10 UIKitCore 0x000000018e1b5fa4 -[UINib instantiateWithOwner:options:] + 2288 (UINib.m:389)
11 UIKitCore 0x000000018e72dd9c -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 284 (UIStoryboard.m:233)
12 UIKitCore 0x000000018e72dc34 -[UIStoryboard _instantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 128 (UIStoryboard.m:212)
13 UIKitCore 0x000000018e5ae068 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 184 (UIApplication.m:4396)
14 UIKitCore 0x000000018e5ae59c -[UIApplication _loadMainInterfaceFile] + 276 (UIApplication.m:0)
15 UIKitCore 0x000000018e5accec -[UIApplication _runWithMainScene:transitionContext:completion:] + 996 (UIApplication.m:4155)
16 UIKitCore 0x000000018dc02f20 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152 (_UISceneLifecycleMultiplexer.m:436)
17 UIKitCore 0x000000018e171054 _UIScenePerformActionsWithLifecycleActionMask + 112 (_UISceneLifecycleState.m:109)
18 UIKitCore 0x000000018dc03ab8 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 224 (_UISceneLifecycleMultiplexer.m:549)
19 UIKitCore 0x000000018dc034c0 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 300 (_UISceneLifecycleMultiplexer.m:498)
20 UIKitCore 0x000000018dc038c8 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 768 (_UISceneLifecycleMultiplexer.m:548)
21 UIKitCore 0x000000018dc03104 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 340 (_UISceneLifecycleMultiplexer.m:454)
22 UIKitCore 0x000000018dc0b650 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 196 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:72)
23 UIKitCore 0x000000018e07d6c4 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 892 (BSAnimationSettings+UIKit.m:50)
24 UIKitCore 0x000000018e18977c _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 272 (_UISceneSettingsDiffAction.m:23)
25 UIKitCore 0x000000018dc0b348 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 384 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:57)
26 UIKitCore 0x000000018da3284c __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 776 (UIScene.m:1413)
27 UIKitCore 0x000000018da311c0 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 256 (UIScene.m:1134)
28 UIKitCore 0x000000018da32474 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 248 (UIScene.m:1380)
29 UIKitCore 0x000000018e5aaf84 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 572 (UIApplication.m:3681)
30 UIKitCore 0x000000018e0a6ef0 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388 (UIApplicationSceneClientAgent.m:45)
31 FrontBoardServices 0x000000019b8b63bc -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 432 (FBSScene.m:435)
32 FrontBoardServices 0x000000019b8e1d04 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.200 + 128 (FBSWorkspaceScenesClient.m:365)
33 FrontBoardServices 0x000000019b8c54a0 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:355)
34 FrontBoardServices 0x000000019b8e19c8 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372 (FBSWorkspaceScenesClient.m:364)
35 libdispatch.dylib 0x000000018b7e9db0 _dispatch_client_callout + 20 (object.m:559)
36 libdispatch.dylib 0x000000018b7ed738 _dispatch_block_invoke_direct + 268 (queue.c:468)
37 FrontBoardServices 0x000000019b90a250 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:184)
38 FrontBoardServices 0x000000019b909ee0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 448 (FBSSerialQueue.m:227)
39 FrontBoardServices 0x000000019b90a434 -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:258)
40 CoreFoundation 0x000000018bb7176c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1967)
41 CoreFoundation 0x000000018bb71668 __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2011)
42 CoreFoundation 0x000000018bb70960 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2048)
43 CoreFoundation 0x000000018bb6aa8c __CFRunLoopRun + 824 (CFRunLoop.c:2925)
44 CoreFoundation 0x000000018bb6a21c CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
45 GraphicsServices 0x00000001a366e784 GSEventRunModal + 164 (GSEvent.c:2259)
46 UIKitCore 0x000000018e5a8fe0 -[UIApplication _run] + 1072 (UIApplication.m:3253)
47 UIKitCore 0x000000018e5ae854 UIApplicationMain + 168 (UIApplication.m:4707)
48 Runner 0x000000010292ea2c main + 64 (AppDelegate.swift:8)
49 libdyld.dylib 0x000000018b82a6b0 start + 4

Related

iOS 16.1 objc_release Crash [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 days ago.
Improve this question
We have collected many crashes of this type in our APP on 16.1 or later systems, but it is normal on other systems. It looks like memory issues related to objc_release, but our code should be correct. Could someone help to locate the cause?
Hardware Model: iPhone14,3
Process: MyAPP [6850]
Path: /private/var/containers/Bundle/Application/C129C91C-89D6-4C6F-9057-D884CFACDB41/MyAPP.app/MyAPP
Version: 6.0.2 (6021)
AppStoreTools: 14C17
AppVariant: 1:iPhone14,3:15
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Date/Time: 2023-02-08 13:32:40.1633 +0800
Launch Time: 2023-02-07 01:19:36.8931 +0800
OS Version: iPhone OS 16.3 (20D47)
Release Type: User
Baseband Version: 2.40.01
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000002008ff
Exception Codes: 0x0000000000000001, 0x00000000002008ff
VM Region Info: 0x2008ff is not in any region. Bytes before following region: 4361615105
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 104190000-104f64000 [ 13.8M] r-x/r-x SM=COW .../MyAPP
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [6850]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000187a9754c objc_release_x0 + 8 (:-1)
1 MyAPP 0x00000001058474ec +[GSTree buildMenuTreeWithMenus:] + 792
2 MyAPP 0x00000001057d0230 -[SystemInfoCenter buildMenuTressWithMenus:] + 48
3 MyAPP 0x00000001057c8ad4 -[SystemInfoCenter parseMenu:] + 72
4 MyAPP 0x00000001057c8820 -[SystemInfoCenter parseSystemConfiguration:updatePersistance:] + 100
5 MyAPP 0x00000001057c741c -[SystemInfoCenter loadSystemInfoFromPersistance] + 92
6 MyAPP 0x00000001057c73a4 -[SystemInfoCenter systemInitializeWithAppName:productionVersion:] + 120
7 MyAPP 0x00000001051fb3b0 -[AppDelegate logoutSystem:restoreContentVC:] + 1508 (AppDelegate.m:635)
8 MyAPP 0x00000001051f8b40 -[AppDelegate applicationWillEnterForeground:] + 252 (AppDelegate.m:261)
9 MyAPP 0x00000001070bb33c -[NBSAppAgent nbs_applicationWillEnterForeground:] + 952
10 UIKitCore 0x0000000190c8c63c -[UIApplication _sendWillEnterForegroundCallbacks] + 184 (UIApplication.m:11710)
11 UIKitCore 0x0000000190c8c1a0 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke_2 + 1272 (_UISceneLifecycleMultiplexer.m:651)
12 UIKitCore 0x0000000190b85e74 _UIScenePerformActionsWithLifecycleActionMask + 108 (_UISceneLifecycleState.m:109)
13 UIKitCore 0x0000000190ec7d78 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 (_UISceneLifecycleMultiplexer.m:564)
14 UIKitCore 0x0000000190d78adc -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220 (_UISceneLifecycleMultiplexer.m:513)
15 UIKitCore 0x0000000190d78904 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 (_UISceneLifecycleMultiplexer.m:563)
16 UIKitCore 0x0000000190d784b4 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 (_UISceneLifecycleMultiplexer.m:469)
17 UIKitCore 0x0000000190d78380 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 148 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:73)
18 UIKitCore 0x000000019145c56c +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 (BSAnimationSettings+UIKit.m:54)
19 UIKitCore 0x00000001914f6568 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 (_UISceneSettingsDiffAction.m:27)
20 UIKitCore 0x0000000190c24374 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 (_UISceneSettingsDiffAction.m:20)
21 UIKitCore 0x0000000191097294 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.214 + 556 (UIScene.m:2000)
22 UIKitCore 0x0000000190cf69a0 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 (UIScene.m:1676)
23 UIKitCore 0x0000000190cf6810 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 (UIScene.m:1962)
24 UIKitCore 0x0000000190cf6650 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 (UIApplicationSceneClientAgent.m:86)
25 FrontBoardServices 0x00000001a469566c -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 420 (FBSScene.m:549)
26 FrontBoardServices 0x00000001a46954a8 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 144 (FBSWorkspaceScenesClient.m:579)
27 FrontBoardServices 0x00000001a4698c24 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FBSWorkspace.m:359)
28 FrontBoardServices 0x00000001a4698b40 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 340 (FBSWorkspaceScenesClient.m:578)
29 libdispatch.dylib 0x0000000195f34f88 _dispatch_client_callout + 20 (object.m:560)
30 libdispatch.dylib 0x0000000195f38a08 _dispatch_block_invoke_direct + 264 (queue.c:496)
31 FrontBoardServices 0x00000001a46a2d40 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:157)
32 FrontBoardServices 0x00000001a46a28dc -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 (FBSSerialQueue.m:181)
33 FrontBoardServices 0x00000001a46a5184 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:194)
34 CoreFoundation 0x000000018e9e8f24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
35 CoreFoundation 0x000000018e9f52fc __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
36 CoreFoundation 0x000000018e979220 __CFRunLoopDoSources0 + 340 (CFRunLoop.c:2046)
37 CoreFoundation 0x000000018e98eb7c __CFRunLoopRun + 836 (CFRunLoop.c:2953)
38 CoreFoundation 0x000000018e993eb0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
39 GraphicsServices 0x00000001c8b89368 GSEventRunModal + 164 (GSEvent.c:2196)
40 UIKitCore 0x0000000190e89668 -[UIApplication _run] + 888 (UIApplication.m:3758)
41 UIKitCore 0x0000000190e892cc UIApplicationMain + 340 (UIApplication.m:5348)
42 MyAPP 0x0000000104f65824 main + 1000 (main.m:54)
43 dyld 0x00000001ad28c960 start + 2528 (dyldMain.cpp:1170)
I tried to Google search this question, but I haven't found any clues yet.

Flutter App built on Xcode version 12.5.1 crashes on iOS 14.7

I uploaded an application to AppStore, and it was working fine.
app version 5.0.2
Xcode version 12.5.1
I tried to update the application recently. The app is running fine with the emulator on iOS 15 or 14.5, but we received a 14.8 crash report. We also tested the physical devices on 14.7. It crashes.
app version 5.0.3
Xcode version 12.5.1
Therefore we tried to test the 5.0.2 version on 14.7 (which is the same code), it also crashes. The codebase is basically the same as the one currently on appstore, but it won't run.
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001b9481334 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001d6f05a9c pthread_kill + 272 (pthread.c:1582)
2 libsystem_c.dylib 0x000000019465db84 abort + 124 (abort.c:118)
3 Flutter 0x0000000102b18ed0 0x10282c000 + 3067600
4 Flutter 0x0000000102b19000 0x10282c000 + 3067904
5 Flutter 0x0000000102d12508 0x10282c000 + 5137672
6 Flutter 0x0000000102b7b844 0x10282c000 + 3471428
7 Flutter 0x000000010283fd20 0x10282c000 + 81184
8 Flutter 0x0000000102856410 0x10282c000 + 173072
9 Flutter 0x000000010285624c 0x10282c000 + 172620
10 UIKitCore 0x000000018d88da70 -[UINib instantiateWithOwner:options:] + 2288 (UINib.m:389)
11 UIKitCore 0x000000018de0cb18 -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 284 (UIStoryboard.m:233)
12 UIKitCore 0x000000018de0c9b0 -[UIStoryboard _instantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 128 (UIStoryboard.m:212)
13 UIKitCore 0x000000018dc8c7dc -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 184 (UIApplication.m:4429)
14 UIKitCore 0x000000018dc8cd14 -[UIApplication _loadMainInterfaceFile] + 280 (UIApplication.m:0)
15 UIKitCore 0x000000018dc8b468 -[UIApplication _runWithMainScene:transitionContext:completion:] + 996 (UIApplication.m:4171)
16 UIKitCore 0x000000018d2df1a4 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152 (_UISceneLifecycleMultiplexer.m:436)
17 UIKitCore 0x000000018d848458 _UIScenePerformActionsWithLifecycleActionMask + 104 (_UISceneLifecycleState.m:109)
18 UIKitCore 0x000000018d2dfd3c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 224 (_UISceneLifecycleMultiplexer.m:549)
19 UIKitCore 0x000000018d2df744 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 300 (_UISceneLifecycleMultiplexer.m:498)
20 UIKitCore 0x000000018d2dfb4c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 768 (_UISceneLifecycleMultiplexer.m:548)
21 UIKitCore 0x000000018d2df388 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 340 (_UISceneLifecycleMultiplexer.m:454)
22 UIKitCore 0x000000018d2e78cc __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 196 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:72)
23 UIKitCore 0x000000018d755e84 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 892 (BSAnimationSettings+UIKit.m:50)
24 UIKitCore 0x000000018d861268 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 276 (_UISceneSettingsDiffAction.m:23)
25 UIKitCore 0x000000018d2e75c4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 384 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:57)
26 UIKitCore 0x000000018d10f4ac __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 776 (UIScene.m:1419)
27 UIKitCore 0x000000018d10de2c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 256 (UIScene.m:1140)
28 UIKitCore 0x000000018d10f0d4 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 248 (UIScene.m:1386)
29 UIKitCore 0x000000018dc89700 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 572 (UIApplication.m:3697)
30 UIKitCore 0x000000018d77f4e4 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388 (UIApplicationSceneClientAgent.m:45)
31 FrontBoardServices 0x000000019a8685d8 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 440 (FBSScene.m:435)
32 FrontBoardServices 0x000000019a893d44 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.200 + 128 (FBSWorkspaceScenesClient.m:365)
33 FrontBoardServices 0x000000019a8776a4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:355)
34 FrontBoardServices 0x000000019a893a0c __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372 (FBSWorkspaceScenesClient.m:364)
35 libdispatch.dylib 0x000000018ae8381c _dispatch_client_callout + 20 (object.m:559)
36 libdispatch.dylib 0x000000018ae8730c _dispatch_block_invoke_direct + 268 (queue.c:468)
37 FrontBoardServices 0x000000019a8bbfa0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:184)
38 FrontBoardServices 0x000000019a8bbc30 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 448 (FBSSerialQueue.m:227)
39 FrontBoardServices 0x000000019a8bc184 -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:258)
40 CoreFoundation 0x000000018b210990 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1967)
41 CoreFoundation 0x000000018b21088c __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2011)
42 CoreFoundation 0x000000018b20fb90 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2048)
43 CoreFoundation 0x000000018b209b70 __CFRunLoopRun + 820 (CFRunLoop.c:2925)
44 CoreFoundation 0x000000018b209308 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
45 GraphicsServices 0x00000001a288c734 GSEventRunModal + 164 (GSEvent.c:2259)
46 UIKitCore 0x000000018dc8775c -[UIApplication _run] + 1072 (UIApplication.m:3269)
47 UIKitCore 0x000000018dc8cfcc UIApplicationMain + 168 (UIApplication.m:4740)
48 Runner 0x000000010251f7e0 main + 64 (AppDelegate.swift:5)
49 libdyld.dylib 0x000000018aec5cf8 start + 4

iOS app crashed with error UISearchDisplayControllerNoLongerSupported

I have uploaded an iOS app on the app store. The development build is working perfectly fine and there was no error while debugging the same app in Xcode.
But when the app is live on the app store and the user installs the app from AppStore then the app crashes on tap on the search button.
Below is a screenshot of the crash log:
Launch Time: 2020-04-25 21:51:43.9128 +0530
OS Version: iPhone OS 13.3.1 (17D50)
Release Type: User
Baseband Version: 1.04.06
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x1aa46896c __exceptionPreprocess + 224
1 libobjc.A.dylib 0x1aa181028 objc_exception_throw + 59
2 CoreFoundation 0x1aa35814c +[NSException raise:format:] + 111
3 UIKitCore 0x1aded63f4 UISearchDisplayControllerNoLongerSupported + 215
4 UIKitCore 0x1aded66dc -[UISearchDisplayController initWithCoder:] + 87
5 UIFoundation 0x1adab024c UINibDecoderDecodeObjectForValue + 731
6 UIFoundation 0x1adab0480 UINibDecoderDecodeObjectForValue + 1295
7 UIFoundation 0x1ada4b00c -[UINibDecoder decodeObjectForKey:] + 319
8 UIKitCore 0x1adf1f73c -[UIViewController initWithCoder:] + 1039
9 Rmag.eu 0x102a1b420 0x102954000 + 816160
10 Rmag.eu 0x102a14eb0 0x102954000 + 790192
11 Rmag.eu 0x1029d8908 0x102954000 + 542984
12 Rmag.eu 0x1029d8638 0x102954000 + 542264
13 UIKitCore 0x1ae1f1818 -[UIClassSwapper initWithCoder:] + 2363
14 UIFoundation 0x1adab024c UINibDecoderDecodeObjectForValue + 731
15 UIFoundation 0x1ada4b00c -[UINibDecoder decodeObjectForKey:] + 319
16 UIKitCore 0x1ae1f59c4 -[UIRuntimeConnection initWithCoder:] + 131
17 UIFoundation 0x1adab024c UINibDecoderDecodeObjectForValue + 731
18 UIFoundation 0x1adab0480 UINibDecoderDecodeObjectForValue + 1295
19 UIFoundation 0x1ada4b00c -[UINibDecoder decodeObjectForKey:] + 319
20 UIKitCore 0x1ae1f08f0 -[NSCoder+ 7121136 (UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 491
21 UIKitCore 0x1ae1f3528 -[UINib instantiateWithOwner:options:] + 1115
22 UIKitCore 0x1ae6c5cb0 -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 291
23 Rmag.eu 0x102a1a320 0x102954000 + 811808
24 Rmag.eu 0x102a13d2c 0x102954000 + 785708
25 libobjc.A.dylib 0x1aa17ccc8 -[NSObject performSelector:withObject:withObject:] + 75
26 UIKitCore 0x1ae56a918 -[UIApplication sendAction:to:from:forEvent:] + 99
27 UIKitCore 0x1adf79380 -[UIControl sendAction:to:forEvent:] + 207
28 UIKitCore 0x1adf796f4 -[UIControl _sendActionsForEvents:withEvent:] + 411
29 UIKitCore 0x1adf78704 -[UIControl touchesEnded:withEvent:] + 523
30 UIKitCore 0x1ae5a578c -[UIWindow _sendTouchesForEvent:] + 2083
31 UIKitCore 0x1ae5a6a7c -[UIWindow sendEvent:] + 3335
32 UIKitCore 0x1ae582600 -[UIApplication sendEvent:] + 347
33 UIKitCore 0x1ae5fca58 __dispatchPreprocessedEventFromEventQueue + 5711
34 UIKitCore 0x1ae5ff010 __handleEventQueueInternal + 4927
35 UIKitCore 0x1ae5f8194 __handleHIDEventFetcherDrain + 111
36 CoreFoundation 0x1aa3e4108 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
37 CoreFoundation 0x1aa3e405c __CFRunLoopDoSource0 + 83
38 CoreFoundation 0x1aa3e37c8 __CFRunLoopDoSources0 + 183
39 CoreFoundation 0x1aa3de694 __CFRunLoopRun + 1067
40 CoreFoundation 0x1aa3ddf40 CFRunLoopRunSpecific + 479
41 GraphicsServices 0x1b466e534 GSEventRunModal + 107
42 UIKitCore 0x1ae569580 UIApplicationMain + 1939
43 Rmag.eu 0x102972a9c 0x102954000 + 125596
44 libdyld.dylib 0x1aa25ce18 start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001aa252efc __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001aa1728b8 pthread_kill + 228
2 libsystem_c.dylib 0x00000001aa102af4 __abort + 116
3 libsystem_c.dylib 0x00000001aa102a80 __abort + 0
4 libc++abi.dylib 0x00000001aa21a3c8 __cxa_bad_cast + 0
5 libc++abi.dylib 0x00000001aa21a5c0 demangling_unexpected_handler+ 5568 () + 0
6 libobjc.A.dylib 0x00000001aa181308 _objc_terminate+ 25352 () + 124
7 Rmag.eu 0x0000000102e95040 0x102954000 + 5509184
8 libc++abi.dylib 0x00000001aa227634 std::__terminate(void (*)+ 58932 ()) + 20
9 libc++abi.dylib 0x00000001aa2271ec __cxa_rethrow + 148
10 libobjc.A.dylib 0x00000001aa1811ec objc_exception_rethrow + 44
11 CoreFoundation 0x00000001aa3ddfb0 CFRunLoopRunSpecific + 592
12 GraphicsServices 0x00000001b466e534 GSEventRunModal + 108
13 UIKitCore 0x00000001ae569580 UIApplicationMain + 1940
14 Rmag.eu 0x0000000102972a9c 0x102954000 + 125596
15 libdyld.dylib 0x00000001aa25ce18 start + 4
According to me the app crashed because of error "UISearchDisplayControllerNoLongerSupported". But I am not using "UISearchDisplayController" anywhere in my app.
Below is a screenshot of the code
class SearchBarViewController: BaseViewController, UISearchBarDelegate{
var customTabBarView: CustomTabBar?
#IBOutlet weak var searchBar: UISearchBar!
var navController: UINavigationController?
Please help me to resolve the issue or how can I find the error in the code of the app.
Creating a new SearchBarViewController resolved the issue.
We have to remove the older SearchVar UIViewController from code.

Deployed a react native app in iphone using xcode but app not working

Deployed a react native app on iphone but whenever I try to open the app it shows the name of the app and after few seconds app closes by itself.
While when I run the same app on my ios emulator it works like charm.
What could be the problem?
Thanks in advance
log :
Date/Time: 2018-09-27 17:01:44.8982 +0530
Launch Time: 2018-09-27 17:01:24.8192 +0530
OS Version: iPhone OS 12.0 (16A366)
Baseband Version: 5.10.00
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-create watchdog transgression: com.ccmtTweets.Tweets1234 exhausted real (wall clock) time allowance of 19.95 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-create | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 2.520 (user 2.520, system 0.000), 6% CPU", | "Elapsed application CPU time (seconds): 0.085, 0% CPU" | )
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000224515f0c semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000224364fc4 _dispatch_sema4_wait$VARIANT$mp + 24
2 libdispatch.dylib 0x0000000224365a48 _dispatch_semaphore_wait_slow + 136
3 CFNetwork 0x0000000224fdace8 CFURLConnectionSendSynchronousRequest + 292
4 CFNetwork 0x0000000224f3788c +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 116
5 ccmtTweetApp 0x0000000104dbec44 -[RCTBundleURLProvider isPackagerRunning:] + 1223748 (RCTBundleURLProvider.m:74)
6 ccmtTweetApp 0x0000000104dbeef4 -[RCTBundleURLProvider guessPackagerHost] + 1224436 (RCTBundleURLProvider.m:90)
7 ccmtTweetApp 0x0000000104dbf104 -[RCTBundleURLProvider packagerServerHost] + 1224964 (RCTBundleURLProvider.m:104)
8 ccmtTweetApp 0x0000000104dbf1f8 -[RCTBundleURLProvider jsBundleURLForBundleRoot:fallbackResource:fallbackExtension:] + 1225208 (RCTBundleURLProvider.m:114)
9 ccmtTweetApp 0x0000000104dbf398 -[RCTBundleURLProvider jsBundleURLForBundleRoot:fallbackResource:] + 1225624 (RCTBundleURLProvider.m:127)
10 ccmtTweetApp 0x0000000104c9a0ac -[AppDelegate application:didFinishLaunchingWithOptions:] + 24748 (AppDelegate.m:19)
11 UIKitCore 0x00000002512065f8 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
12 UIKitCore 0x0000000251207d60 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3340
13 UIKitCore 0x000000025120d7ac -[UIApplication _runWithMainScene:transitionContext:completion:] + 1552
14 UIKitCore 0x0000000251a34db8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784
15 UIKitCore 0x0000000251a31364 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
16 UIKitCore 0x0000000251a34a34 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240
17 UIKitCore 0x0000000251a353d4 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1076
18 UIKitCore 0x00000002519f45fc __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 772
19 UIKitCore 0x00000002519f42a8 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
20 UIKitCore 0x0000000251a37844 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
21 UIKitCore 0x0000000251a38334 _performActionsWithDelayForTransitionContext + 112
22 UIKitCore 0x0000000251a376fc -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
23 UIKitCore 0x0000000251a30a10 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
24 UIKitCore 0x000000025120bca4 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
25 UIKitCore 0x000000025123d45c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364
26 FrontBoardServices 0x00000002273bb890 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 444
27 FrontBoardServices 0x00000002273c6658 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 260
28 FrontBoardServices 0x00000002273c5d50 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
29 libdispatch.dylib 0x00000002243c4484 _dispatch_client_callout + 16
30 libdispatch.dylib 0x0000000224367e58 _dispatch_block_invoke_direct$VARIANT$mp + 224
31 FrontBoardServices 0x00000002273fa640 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
32 FrontBoardServices 0x00000002273fa2cc -[FBSSerialQueue _performNext] + 416
33 FrontBoardServices 0x00000002273fa8e8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
34 CoreFoundation 0x000000022491a5b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
35 CoreFoundation 0x000000022491a538 __CFRunLoopDoSource0 + 88
36 CoreFoundation 0x0000000224919e1c __CFRunLoopDoSources0 + 176
37 CoreFoundation 0x0000000224914ce8 __CFRunLoopRun + 1040
38 CoreFoundation 0x00000002249145b8 CFRunLoopRunSpecific + 436
39 GraphicsServices 0x0000000226b88584 GSEventRunModal + 100
40 UIKitCore 0x000000025120f558 UIApplicationMain + 212
41 ccmtTweetApp 0x0000000104c9a4ec main + 25836 (main.m:14)
42 libdyld.dylib 0x00000002243d4b94 start + 4

Decipher the iOS crashlog. The program crashes at layoutIfNeeded

I've got crash logs for my app from App Store. I'm not able to reproduce the crash and having a hard time deciphering it.
Following is the log -
Incident Identifier: AEF0FFDD-77E4-460F-97E4-B97A32EAE36D
CrashReporter Key: 78177aeeda1175c67f4467d02c023a2a165d1a01
Hardware Model: iPhone7,1
Process: Visits [4558]
Path: /private/var/containers/Bundle/Application/81AC75BC-433C-43E7-887D-8FC6BF5B5703/Visits.app/Visits
Identifier: com.x.y
Version: 1.1.1 (1.1.1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.x.y [1143]
Date/Time: 2018-07-20 22:30:36.6608 +0530
Launch Time: 2018-07-20 22:30:35.9017 +0530
OS Version: iPhone OS 11.4.1 (15G77)
Baseband Version: 6.80.00
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x184136d8c __exceptionPreprocess + 228 (NSException.m:166)
1 libobjc.A.dylib 0x1832f05ec objc_exception_throw + 56 (objc-exception.mm:521)
2 CoreFoundation 0x1840cfd80 -[__NSSingleObjectArrayI objectAtIndex:] + 128 (NSSingleObjectArray.m:16)
3 UIKit 0x18e6b0aa8 -[UITableViewDataSource tableView:cellForRowAtIndexPath:] + 172 (UITableViewDataSource.m:170)
4 UIKit 0x18e3c90f4 -[UITableViewController tableView:cellForRowAtIndexPath:] + 68 (UITableViewController.m:441)
5 UIKit 0x18de130cc -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 668 (UITableView.m:13463)
6 UIKit 0x18de12d84 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 80 (UITableView.m:13514)
7 UIKit 0x18de11aa0 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2280 (UITableView.m:2599)
8 UIKit 0x18de0d5ec -[UITableView layoutSubviews] + 140 (UITableView.m:8565)
9 UIKit 0x18dd4a6f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1420 (UIView.m:15239)
10 QuartzCore 0x1882bfe54 -[CALayer layoutSublayers] + 184 (CALayer.mm:9357)
11 QuartzCore 0x1882c3fe4 CA::Layer::layout_if_needed(CA::Transaction*) + 324 (CALayer.mm:9237)
12 UIKit 0x18dd62bf4 -[UIView(Hierarchy) layoutBelowIfNeeded] + 548 (UIView.m:10438)
13 Visits 0x1007a8300 MainViewController.initialSetupForScreen() + 804 (MainViewController.swift:217)
14 Visits 0x1007a7ea4 MainViewController.viewDidLoad() + 924 (MainViewController.swift:175)
15 Visits 0x1007a8838 #objc MainViewController.viewDidLoad() + 28
16 UIKit 0x18dd51e64 -[UIViewController loadViewIfRequired] + 1020 (UIViewController.m:3192)
17 UIKit 0x18dd51a50 -[UIViewController view] + 28 (UIViewController.m:3214)
18 UIKit 0x18dd42ce4 -[UIWindow addRootViewControllerViewIfPossible] + 136 (UIWindow.m:1358)
19 UIKit 0x18dd41b18 -[UIWindow _setHidden:forced:] + 272 (UIWindow.m:1455)
20 UIKit 0x18ddcf62c -[UIWindow makeKeyAndVisible] + 48 (UIWindow.m:4883)
21 UIKit 0x18dd45274 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3660 (UIApplication.m:2210)
22 UIKit 0x18dd125e0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1680 (UIApplication.m:3491)
23 UIKit 0x18e342b1c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784 (_UICanvasLifecycleMonitor.m:175)
24 UIKit 0x18dd11dd0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160 (_UICanvas.m:591)
25 UIKit 0x18dd11c6c -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240 (_UICanvasLifecycleMonitor.m:153)
26 UIKit 0x18dd10afc -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 724 (_UICanvasLifecycleMonitor.m:229)
27 UIKit 0x18e9a684c __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 296 (_UIApplicationCanvas.m:0)
28 UIKit 0x18dd101ec -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432 (_UIApplicationCanvas.m:156)
29 UIKit 0x18e78bac8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220 (_UICanvasLifecycleSettingsDiffAction.m:211)
30 UIKit 0x18e8d9bf8 _performActionsWithDelayForTransitionContext + 112 (_UICanvasSettingsDiffAction.m:34)
31 UIKit 0x18dd0fc0c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248 (_UICanvasLifecycleSettingsDiffAction.m:182)
32 UIKit 0x18dd0f5a8 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368 (_UICanvas.m:517)
33 UIKit 0x18dd0c5e0 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540 (UIApplication.m:3109)
34 UIKit 0x18dd0c330 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364 (UIApplicationSceneClientAgent.m:41)
35 FrontBoardServices 0x186938470 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364 (FBSSceneImpl.m:460)
36 FrontBoardServices 0x186940d6c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224 (FBSWorkspace.m:606)
37 libdispatch.dylib 0x183a28a60 _dispatch_client_callout + 16 (object.m:507)
38 libdispatch.dylib 0x183a30170 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:3018)
39 FrontBoardServices 0x18696c878 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:164)
40 FrontBoardServices 0x18696c51c -[FBSSerialQueue _performNext] + 404 (FBSSerialQueue.m:196)
41 FrontBoardServices 0x18696cab8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:232)
42 CoreFoundation 0x1840df404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1982)
43 CoreFoundation 0x1840dec2c __CFRunLoopDoSources0 + 276 (CFRunLoop.c:2017)
44 CoreFoundation 0x1840dc79c __CFRunLoopRun + 1204 (CFRunLoop.c:2920)
45 CoreFoundation 0x183ffcda8 CFRunLoopRunSpecific + 552 (CFRunLoop.c:3245)
46 GraphicsServices 0x185fe2020 GSEventRunModal + 100 (GSEvent.c:2245)
47 UIKit 0x18e01c758 UIApplicationMain + 236 (UIApplication.m:3965)
48 Visits 0x1007a589c main + 56 (Location+CoreDataClass.swift:15)
49 libdyld.dylib 0x183a8dfc0 start + 4
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000183bbd2e0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000183d5e288 pthread_kill$VARIANT$mp + 376 (pthread.c:1484)
2 libsystem_c.dylib 0x0000000183b2bd0c abort + 140 (abort.c:91)
3 libc++abi.dylib 0x00000001832c72c8 abort_message + 132 (abort_message.cpp:75)
4 libc++abi.dylib 0x00000001832c7470 default_terminate_handler() + 304 (cxa_default_handlers.cpp:68)
5 libobjc.A.dylib 0x00000001832f08d4 _objc_terminate() + 124 (objc-exception.mm:657)
6 libc++abi.dylib 0x00000001832e137c std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:66)
7 libc++abi.dylib 0x00000001832e1400 std::terminate() + 84 (cxa_handlers.cpp:97)
8 libdispatch.dylib 0x0000000183a28a74 _dispatch_client_callout + 36 (object.m:510)
9 libdispatch.dylib 0x0000000183a30170 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:3018)
10 FrontBoardServices 0x000000018696c878 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:164)
11 FrontBoardServices 0x000000018696c51c -[FBSSerialQueue _performNext] + 404 (FBSSerialQueue.m:196)
12 FrontBoardServices 0x000000018696cab8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:232)
13 CoreFoundation 0x00000001840df404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1982)
14 CoreFoundation 0x00000001840dec2c __CFRunLoopDoSources0 + 276 (CFRunLoop.c:2017)
15 CoreFoundation 0x00000001840dc79c __CFRunLoopRun + 1204 (CFRunLoop.c:2920)
16 CoreFoundation 0x0000000183ffcda8 CFRunLoopRunSpecific + 552 (CFRunLoop.c:3245)
17 GraphicsServices 0x0000000185fe2020 GSEventRunModal + 100 (GSEvent.c:2245)
18 UIKit 0x000000018e01c758 UIApplicationMain + 236 (UIApplication.m:3965)
19 Visits 0x00000001007a589c main + 56 (Location+CoreDataClass.swift:15)
20 libdyld.dylib 0x0000000183a8dfc0 start + 4
Following is the code snippet where the program crashes. The crash happens at the self.view.layoutIfNeeded().
func initialSetupForScreen(){
let screenHeight = UIScreen.main.bounds.height
let statusBarHeight = UIApplication.shared.statusBarFrame.height
fullyOpenSheetTop = -(screenHeight - (statusBarHeight * 2))
partiallyOpenSheetTop = -((screenHeight * 0.50) - titleBarHeight)
closedSheetTop = -titleBarHeight
notVisibleSheetTop = 40 //(+40 for iphone X)
fullyOrPartiallyThreshold = (fullyOpenSheetTop + partiallyOpenSheetTop)/2
partiallyOrClosedThreshold = (partiallyOpenSheetTop + closedSheetTop)/2
// set primary & secondary sheet height //(+40 for iphone X) (-40 fixed for iphone X)
primarySheetViewHeightConstraint.constant = -fullyOpenSheetTop
secondarySheetViewHeightConstraint.constant = -fullyOpenSheetTop
// primary sheet is set to fully open state
primarySheetViewTopConstraint.constant = fullyOpenSheetTop
primarySheetCurrentState = .fullyOpen
// secondary sheet is set to not visible state
secondarySheetViewTopConstraint.constant = notVisibleSheetTop
secondarySheetCurrentState = .notVisible
// settings View move it out of screen
settingsViewTopConstraint.constant = notVisibleSheetTop
primarySheetController.configurePrimarySheetContentView()
self.view.layoutIfNeeded()
}
Earlier, I was calling this function inside my viewDidLoad. I thought it was too early to call layoutIfNeeded inside viewDidLoad. So I moved the function to viewWillAppear. However, the crashes still seem to be happening . What am I missing/overseeing?
The crash is happening across very few devices and I'm not able to reproduce it.

Resources