app crash as soon as it starts on Xcode 11 - ios

In Xcode 11, My app runs fine for the first time but once it is killed or crashed, it can not be opened, it keep crashing with below error log
crash log
1 libobjc.A.dylib 0x1866b80a4 objc_exception_throw + 55
2 CoreFoundation 0x186884ac8 +[NSException raise:format:] + 107
3 UIFoundation 0x189f1eed0 UINibDecoderDecodeObjectForValue + 407
4 UIFoundation 0x189ebb6b8 -[UINibDecoder decodeObjectForKey:] + 315
5 Foundation 0x186cb7630 -[NSLayoutConstraint initWithCoder:] + 227
6 UIFoundation 0x189f1f010 UINibDecoderDecodeObjectForValue + 727
7 UIFoundation 0x189ebb6b8 -[UINibDecoder decodeObjectForKey:] + 315
8 UIKitCore 0x18a626568 -[UIRuntimeConnection initWithCoder:] + 171
9 UIFoundation 0x189f1f010 UINibDecoderDecodeObjectForValue + 727
10 UIFoundation 0x189f1f244 UINibDecoderDecodeObjectForValue + 1291
11 UIFoundation 0x189ebb6b8 -[UINibDecoder decodeObjectForKey:] + 315
12 UIKitCore 0x18a6215b4 -[NSCoder+ 6874548 (UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 487
13 UIKitCore 0x18a6241a4 -[UINib instantiateWithOwner:options:] + 1111
14 UIKitCore 0x18a36e8b0 -[UIViewController _loadViewFromNibNamed:bundle:] + 363
15 UIKitCore 0x18a36f2ec -[UIViewController loadView] + 175
16 UIKitCore 0x18a36f5a4 -[UIViewController loadViewIfRequired] + 171
17 UIKitCore 0x18a2e1f70 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 167
18 UIKitCore 0x18a2e227c -[UINavigationController _startTransition:fromViewController:toViewController:] + 175
19 UIKitCore 0x18a2e30b0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 1135
20 UIKitCore 0x18a2e43f4 -[UINavigationController __viewWillLayoutSubviews] + 163
21 UIKitCore 0x18a2c81c8 -[UILayoutContainerView layoutSubviews] + 223
22 UIKitCore 0x18adf6d3c -[UIView+ 15088956 (CALayerDelegate) layoutSublayersOfLayer:] + 2139
23 QuartzCore 0x18d2f012c -[CALayer layoutSublayers] + 283
24 QuartzCore 0x18d2f495c CA::Layer::layout_if_needed+ 1399132 (CA::Transaction*) + 479
25 QuartzCore 0x18d300350 CA::Layer::layout_and_display_if_needed+ 1446736 (CA::Transaction*) + 135
26 QuartzCore 0x18d248edc CA::Context::commit_transaction+ 696028 (CA::Transaction*, double) + 295
27 QuartzCore 0x18d272e44 CA::Transaction::commit+ 867908 () + 675
28 UIKitCore 0x18a988f98 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 79
29 CoreFoundation 0x18690cec4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 19
30 CoreFoundation 0x18690c664 __CFRunLoopDoBlocks + 263
31 CoreFoundation 0x1869078e0 __CFRunLoopRun + 1099
32 CoreFoundation 0x18690716c CFRunLoopRunSpecific + 463
33 GraphicsServices 0x19073f328 GSEventRunModal + 103
34 UIKitCore 0x18a971d0c UIApplicationMain + 1935
35 ------------- 0x104ea06c0 0x104e94000 + 50880
36 libdyld.dylib 0x186792424 start + 3```

I had the same problem and it was because of a UITextView in a storyboard and a critical issue in Xcode 11.2 fixed in Xcode 11.2.1 GM : https://developer.apple.com/documentation/xcode_release_notes/xcode_11_2_1_gm_seed_release_notes/
This update fixes a critical issue that could cause apps using UITextView to crash when run on previous versions of iOS, iPadOS, or tvOS. Please see the release notes.

Related

-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256

Over the last week, I've noticed a lot of -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256 crashes on iPhone 14 Pro devices running iOS 16.1.1.
The tableView where this problem originates has a constant number of rows and sections, so the datasource is never modified.
The crashes are also being reported to Crashlytics and Sentry, but never make it into the Apple Organizer.
Any idea what's going on? How can I resolve this issue?
Crashed: com.apple.main-thread
0 App 0x90e74 SettingsViewController.tableView(_:cellForRowAt:) + 4374285940 (SettingsViewController.swift:4374285940)
1 App 0x91210 #objc SettingsViewController.tableView(_:cellForRowAt:) + 4374286864 (<compiler-generated>:4374286864)
2 UIKitCore 0x14beec -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256
3 UIKitCore 0x11f844 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 596
4 UIKitCore 0x59350 -[UITableView _updateVisibleCellsNow:] + 1088
5 UIKitCore 0x58e44 -[UITableView layoutSubviews] + 148
6 UIKitCore 0x5020 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980
7 QuartzCore 0x99ec CA::Layer::layout_if_needed(CA::Transaction*) + 500
8 UIKitCore 0xd21dc -[UIView(Hierarchy) layoutBelowIfNeeded] + 292
9 UIKitCore 0x3dc0c -[UINavigationController _layoutViewController:] + 816
10 UIKitCore 0x3d8d8 -[UINavigationController _layoutTopViewControllerLookForNested:] + 436
11 UIKitCore 0x1506dc -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 892
12 UIKitCore 0x150324 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 296
13 UIKitCore 0x14f8e4 -[UINavigationTransitionView _cleanupTransition] + 536
14 UIKitCore 0x14f634 +[UIView(UIViewAnimationWithBlocks) conditionallyAnimate:withAnimation:layout:completion:] + 136
15 UIKitCore 0x1a8c0c -[UINavigationTransitionView transition:fromView:toView:] + 1612
16 UIKitCore 0x1a8270 -[UINavigationController _startTransition:fromViewController:toViewController:] + 2104
17 UIKitCore 0x1a6fb4 -[UINavigationController _startDeferredTransitionIfNeeded:] + 608
18 UIKitCore 0x1a6604 -[UINavigationController __viewWillLayoutSubviews] + 96
19 UIKitCore 0x1a6568 -[UILayoutContainerView layoutSubviews] + 172
20 UIKitCore 0x5020 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980
21 QuartzCore 0x99ec CA::Layer::layout_if_needed(CA::Transaction*) + 500
22 QuartzCore 0x1d0a0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148
23 QuartzCore 0x2e5b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456
24 QuartzCore 0x635ec CA::Transaction::commit() + 652
25 QuartzCore 0x4c8cc CA::Transaction::flush_as_runloop_observer(bool) + 88
26 UIKitCore 0x504b44 _UIApplicationFlushCATransaction + 52
27 UIKitCore 0x652740 _UIUpdateSequenceRun + 84
28 UIKitCore 0xc99fd0 schedulerStepScheduledMainSection + 172
29 UIKitCore 0xc9919c runloopSourceCallback + 92
30 CoreFoundation 0xd5f54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
31 CoreFoundation 0xe232c __CFRunLoopDoSource0 + 176
32 CoreFoundation 0x66210 __CFRunLoopDoSources0 + 244
33 CoreFoundation 0x7bba8 __CFRunLoopRun + 836
34 CoreFoundation 0x80ed4 CFRunLoopRunSpecific + 612
35 GraphicsServices 0x1368 GSEventRunModal + 164
36 UIKitCore 0x3a23d0 -[UIApplication _run] + 888
37 UIKitCore 0x3a2034 UIApplicationMain + 340
38 App 0x8020 main + 41 (AppDelegate.swift:41)
39 ??? 0x1aa7e0960 (Missing)
I discovered that there was a forced unwrapping deep inside my codebase. I would encourage you to search for any forced unwrapping.

Crash when open three time 'NSInternalInconsistencyException', reason: 'Expression 0 + 0.0291667*0 + 0.00277778*369 unable to find variable UIWindow:

This crash happens in a UINavigationController for three times (present and dismiss consequently for 2 times after the first open).
I made a debug by using breakpoints and I figured that it happens in the presented ViewController after the viewWillAppear finish and before the viewWillLayoutSubviews.
However, it didn't stop between my lines of code so I can't detect the cause of the error.
Happens in IOS 12 ONLY (Works fine in IOS 13)
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expression 0 + 0.0291667*0 + 0.00277778*369 unable to find variable UIWindow:0x7fb745603f60.minX{id: 21963} in engine 0x0'
*** First throw call stack:
(
0 CoreFoundation 0x000000011709929b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000116635735 objc_exception_throw + 48
2 CoreFoundation 0x0000000117099022 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000112f5bc10 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 Foundation 0x000000011317221b -[NSISLinearExpression addVariable:coefficient:] + 341
5 UIKitCore 0x000000011ccb8166 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:onBehalfOfLayoutGuide:] + 3120
6 UIKitCore 0x000000011ccb7527 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:] + 289
7 Foundation 0x000000011317e0d3 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 96
8 Foundation 0x000000011317a3e8 -[NSLayoutConstraint _containerGeometryDidChange] + 117
9 UIKitCore 0x000000011cca33fa _UIViewEnumerateConstraints + 710
10 UIKitCore 0x000000011ccb10bc __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 315
11 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
12 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
13 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
14 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
15 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
16 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
17 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
18 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
19 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
20 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
21 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
22 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
23 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
24 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
25 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
26 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
27 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
28 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
29 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
30 UIKitCore 0x000000011d1d6075 -[UIScrollView _switchToLayoutEngine:] + 106
31 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
32 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
33 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
34 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
35 UIKitCore 0x000000011ccafd4d -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 209
36 UIKitCore 0x000000011cca1712 -[UIView(UIConstraintBasedLayout) _layoutEngine_windowDidChange] + 130
37 UIKitCore 0x000000011d4da793 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 170
38 UIKitCore 0x000000011d4da9ab -[UIView(Internal) _didMoveFromWindow:toWindow:] + 706
39 UIKitCore 0x000000011d4cd091 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151
40 UIKitCore 0x000000011d4ccf70 -[UIView(Hierarchy) _postMovedFromSuperview:] + 804
41 UIKitCore 0x000000011d4dd9a5 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1951
42 UIKitCore 0x000000011d0d17f1 -[UINavigationTransitionView transition:fromView:toView:] + 627
43 UIKitCore 0x000000011d0b63a6 -[UINavigationController _startTransition:fromViewController:toViewController:] + 3189
44 UIKitCore 0x000000011d0b6857 -[UINavigationController _startDeferredTransitionIfNeeded:] + 896
45 UIKitCore 0x000000011d0b7bac -[UINavigationController __viewWillLayoutSubviews] + 150
46 UIKitCore 0x000000011d04363f -[UILayoutContainerView layoutSubviews] + 217
47 UIKitCore 0x000000011d4e4015 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1441
48 QuartzCore 0x0000000114fb6d3d -[CALayer layoutSublayers] + 175
49 QuartzCore 0x0000000114fbbbf7 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395
50 QuartzCore 0x0000000114f34aa6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342
51 QuartzCore 0x0000000114f6bc2a _ZN2CA11Transaction6commitEv + 576
52 UIKitCore 0x000000011cdf48f5 _afterCACommitHandler + 268
53 CoreFoundation 0x0000000116ffc037 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
54 CoreFoundation 0x0000000116ff64ce __CFRunLoopDoObservers + 430
55 CoreFoundation 0x0000000116ff6b61 __CFRunLoopRun + 1537
56 CoreFoundation 0x0000000116ff6221 CFRunLoopRunSpecific + 625
57 GraphicsServices 0x000000011c65e1dd GSEventRunModal + 62
58 UIKitCore 0x000000011cdcb115 UIApplicationMain + 140
59 Almtaar 0x000000010d43a1ab main + 75
60 libdyld.dylib 0x0000000118e83551 start + 1
61 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

my app crash in uikit ,only happen on IPhone X and above exception name NSInternalInconsistencyException

Failed to load bounding path bitmap data from the asset manager for asset name: BoundingPathBitmap-1125x2436-375x812-3.00x
The crash happen on the viewcontroller contain UIScrollView When open it,and only happens with the iPhone X and above
We develop app UI use storyboard
0 CoreFoundation ___exceptionPreprocess + 228
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation +[_CFXNotificationTokenRegistration keyCallbacks]
3 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4 UIKitCore -[_UIScreenBezierBoundingPathUtilities _loadBitmapForScreen:type:] + 1124
5 UIKitCore -[_UIScreenBezierBoundingPathUtilities initWithScreen:] + 144
6 UIKitCore +[_UIScreenBoundingPathUtilities boundingPathUtilitiesForScreen:] + 108
7 UIKitCore -[UIScreen _boundingPathUtilities] + 56
8 UIKitCore -[UIWindow _boundingPath] + 168
9 UIKitCore -[UIView(UIViewBoundingPathSupportInternal) _effectiveBoundingPathAndBoundingPathView:] + 256
10 UIKitCore -[UIView(UIViewBoundingPathSupport) _inscribedRectInBoundingPathByInsettingRect:onEdges:withOptions:] + 88
11 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForTrailingEdgeAccessoryWithBoundingPathEdgesToUse:safeAreaInsets:bounds:scale:accessoryWidth:additionalInsetFromEdge:] + 180
12 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForAccessoryOnEdge:hasCustomClientInsets:accessorySize:additionalInsetFromEdge:] + 1388
13 UIKitCore -[UIScrollView(UIScrollViewInternal) _effectiveVerticalScrollIndicatorInsets] + 152
14 UIKitCore -[UIScrollView _layoutVerticalScrollIndicatorWithBounds:effectiveInset:contentOffset:fraction:additionalInset:cornerAdjust:showing:recalcSize:] + 252
15 UIKitCore -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 1040
16 UIKitCore -[UIScrollView _updateForChangedScrollIndicatorRelatedInsets] + 132
17 UIKitCore __UIScrollViewAdjustForOverlayInsetsChangeIfNecessary + 512
18 UIKitCore -[UIScrollView(UIScrollViewInternal) setSafeAreaInsets:] + 312
19 UIKitCore -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 1288
20 UIKitCore -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 124
21 UIKitCore -[UIScrollView(_UIOldConstraintBasedLayoutSupport) _resizeWithOldSuperviewSize:] + 52
22 CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 464
23 UIKitCore -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
24 UIKitCore -[UIView(AdditionalLayoutSupport) _is_layout] + 152
25 UIKitCore -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 988
26 UIKitCore -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1380
27 QuartzCore 0x00000001ca79e000 + 1309564
28 QuartzCore 0x00000001ca79e000 + 1329972
29 QuartzCore 0x00000001ca79e000 + 669080
30 QuartzCore 0x00000001ca79e000 + 859848
31 QuartzCore 0x00000001ca79e000 + 863536
32 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
33 CoreFoundation ___CFRunLoopDoObservers + 412
34 CoreFoundation ___CFRunLoopRun + 1264
35 CoreFoundation CFRunLoopRunSpecific + 436
36 GraphicsServices GSEventRunModal + 100
37 UIKitCore UIApplicationMain + 212
38 live main (main.mm:23)
39 libdyld.dylib 0x00000001c5d2a000 + 2996
hope someone could give me some advice, thanks
The same crash also happened in my app.
When I turned off the 'Show Horizontal Indicator' and 'Show Vertical Indicator' on the storyboard, the crash no longer occurred.
It just happened with my app .. Fixed ,
Delete the app and restart Simulator ..
^ command + shift + K to clean build folder

iOS app crashing on startup when there is no network connection

As the title says, my app immediately crashes when run if there is no internet connection/airplane mode is on. The thing is, when I set breakpoints it doesn't even make it to any of my code. Not a single viewDidLoad or even AppDelegate function gets called, and the error message doesn't seem like something that would be related to not having a network connection:
2019-03-21 10:30:20.193955-0500 AppName[98957:977030] *** Terminating
app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle: 'NSBundle
<bundleFilePath> (loaded)' with name
'BYZ-38-t0r-view-8bC-Xf-vdC''
(I obviously inserted some fake values into their for privacy)
Call stack:
*** First throw call stack:
(
0 CoreFoundation 0x00000001036cb1bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000102c69735 objc_exception_throw + 48
2 CoreFoundation 0x00000001036cb015 +[NSException raise:format:] + 197
3 UIKitCore 0x00000001088edd94 -[UINib instantiateWithOwner:options:] + 497
4 UIKitCore 0x0000000108661452 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
5 UIKitCore 0x0000000108661ddc -[UIViewController loadView] + 177
6 UIKitCore 0x00000001086620ee -[UIViewController loadViewIfRequired] + 175
7 UIKitCore 0x0000000108662940 -[UIViewController view] + 27
8 UIKitCore 0x000000010858134c -[UIPresentationController __sizeClassPair] + 62
9 UIKitCore 0x0000000108675428 -[UIViewController _presentViewController:withAnimationController:completion:] + 2300
10 UIKitCore 0x000000010867874b __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 99
11 UIKitCore 0x0000000108678dd9 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 511
12 UIKitCore 0x00000001086786b1 -[UIViewController _presentViewController:animated:completion:] + 173
13 UIKitCore 0x00000001086789f0 -[UIViewController presentViewController:animated:completion:] + 150
14 AppName 0x0000000100f1125e $SSo16UIViewControllerC12DataScoutProE27showDismissiveAlertMesssage7messageySS_tF + 254
15 AppName 0x0000000100e58a97 $S12AppName18HomeViewControllerC10commonInit33_90D4AB13D5DB6EAFA2D0742F81F552BALLyyF + 727
16 AppName 0x0000000100e58462 $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfc + 146
17 AppName 0x0000000100e584df $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfcTo + 47
18 UIKitCore 0x00000001088ec166 -[UIClassSwapper initWithCoder:] + 246
19 UIFoundation 0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
20 UIFoundation 0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
21 UIKitCore 0x00000001088f07b8 -[UIRuntimeConnection initWithCoder:] + 178
22 UIFoundation 0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
23 UIFoundation 0x000000010c8f3854 UINibDecoderDecodeObjectForValue + 1428
24 UIFoundation 0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
25 UIKitCore 0x00000001088ee067 -[UINib instantiateWithOwner:options:] + 1220
26 UIKitCore 0x0000000108e228b6 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
27 UIKitCore 0x0000000108c8103a -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 112
28 UIKitCore 0x0000000108c8150c -[UIApplication _loadMainInterfaceFile] + 272
29 UIKitCore 0x0000000108c7fb25 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1357
30 UIKitCore 0x000000010849e4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
31 UIKitCore 0x00000001084a729c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
32 UIKitCore 0x000000010849e126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
33 UIKitCore 0x000000010849eae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
34 UIKitCore 0x000000010849ccb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
35 UIKitCore 0x000000010849c95f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
36 UIKitCore 0x00000001084a1a90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
37 UIKitCore 0x00000001084a280e _performActionsWithDelayForTransitionContext + 100
38 UIKitCore 0x00000001084a17ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
39 UIKitCore 0x00000001084a693a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
40 UIKitCore 0x0000000108c7e44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
41 UIKitCore 0x0000000108822d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
42 FrontBoardServices 0x000000010f55e2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
43 FrontBoardServices 0x000000010f569443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
44 FrontBoardServices 0x000000010f568b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
45 libdispatch.dylib 0x000000010548a602 _dispatch_client_callout + 8
46 libdispatch.dylib 0x000000010548db78 _dispatch_block_invoke_direct + 301
47 FrontBoardServices 0x000000010f59dba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
48 FrontBoardServices 0x000000010f59d860 -[FBSSerialQueue _performNext] + 457
49 FrontBoardServices 0x000000010f59de40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
50 CoreFoundation 0x0000000103630721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
51 CoreFoundation 0x000000010362ff93 __CFRunLoopDoSources0 + 243
52 CoreFoundation 0x000000010362a63f __CFRunLoopRun + 1263
53 CoreFoundation 0x0000000103629e11 CFRunLoopRunSpecific + 625
54 GraphicsServices 0x000000010c5b71dd GSEventRunModal + 62
55 UIKitCore 0x0000000108c8181d UIApplicationMain + 140
56 AppName 0x0000000100e8e794 main + 68
57 libdyld.dylib 0x0000000105500575 start + 1
)
I really have no clue what it could be. Tried setting a symbolic breakpoint at [UIViewController _loadViewFromNibNamed:bundle:] but that didn't really give any useful insight. Hope someone can help. I should also mention the only thing I'm doing in AppDelegate is instantiating firebase.
Helpful guy over at reddit figured it out for me. Didn't realize but there was an init() function on my initial view controller that the last guy made which checked the internet connection and redirected to a different page if there wasn't one.

UIView(AdditionalLayoutSupport) _switchToLayoutEngine Xcode Crash

I'm dealing with a weird crash which I didn't find a solution yet for.
The title of the crash in Organizer is UIKit: __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 316 and the whole stacktrace is below.
I've checked the startController(_:) method from AppDelegate and everything seems to be fine. Is it a constraint issue maybe? What else could it be?
Last Exception Backtrace:
0 CoreFoundation 0x1d57bb38 __exceptionPreprocess + 124 (NSException.m:165)
1 libobjc.A.dylib 0x1c803062 objc_exception_throw + 34 (objc-exception.mm:521)
2 CoreFoundation 0x1d580fcc -[NSObject(NSObject) doesNotRecognizeSelector:] + 118 (NSObject.m:328)
3 CoreFoundation 0x1d57f0be ___forwarding___ + 692 (NSForwarding.m:3126)
4 CoreFoundation 0x1d4a7dc4 _CF_forwarding_prep_0 + 20
5 Foundation 0x1ded2b76 -[NSLayoutAnchor nsli_lowerIntoExpression:withCoefficient:forConstraint:] + 498 (NSLayoutAnchor.m:883)
6 Foundation 0x1de1b142 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 104 (NSLayoutConstraint.m:1723)
7 Foundation 0x1de1addc -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 120 (NSLayoutConstraint.m:1606)
8 Foundation 0x1de265b4 -[NSLayoutConstraint _addToEngine:] + 24 (NSLayoutConstraint.m:1621)
9 UIKit 0x228a88b2 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 316 (NSLayoutConstraint_UIKitAdditions.m:3596)
10 Foundation 0x1de1a97e -[NSISEngine withBehaviors:performModifications:] + 258 (NSISEngine.m:1973)
11 UIKit 0x228a873a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 502 (NSLayoutConstraint_UIKitAdditions.m:3585)
12 UIKit 0x227aa5e8 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 (NSLayoutConstraint_UIKitAdditions.m:3550)
13 UIKit 0x228e3654 -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 486 (NSLayoutConstraint_UIKitAdditions.m:3333)
14 UIKit 0x228afe20 -[UIView(UIConstraintBasedLayout) _layoutEngine_windowDidChange] + 120 (NSLayoutConstraint_UIKitAdditions.m:563)
15 UIKit 0x227aa6e0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 208 (UIView.m:12461)
16 UIKit 0x227a9ee0 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 120 (UIView.m:9478)
17 UIKit 0x227a9d6c -[UIView(Hierarchy) _postMovedFromSuperview:] + 710 (UIView.m:361)
18 UIKit 0x227b527a -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1636 (UIView.m:13256)
19 UIKit 0x227b4bfe -[UIView(Hierarchy) addSubview:] + 726 (UIView.m:9004)
20 UIKit 0x227b420c -[UIWindow addRootViewControllerViewIfPossible] + 506 (UIWindow.m:1498)
21 UIKit 0x227b15b6 -[UIWindow _setHidden:forced:] + 282 (UIWindow.m:1572)
22 UIKit 0x22821154 -[UIWindow makeKeyAndVisible] + 38 (UIWindow.m:4934)
23 MyApp 0x1c3f28 AppDelegate.startController(_:) + 978 (AppDelegate.swift:207)
24 MyApp 0x1cad3c specialized AppDelegate.application(_:didFinishLaunchingWithOptions:) + 3082 (AppDelegate.swift:141)
25 MyApp 0x1c3a18 #objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 152 (<compiler-generated>:0)
26 UIKit 0x2281d5c0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 372 (UIApplication.m:1797)
27 UIKit 0x22a1ea46 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3702 (UIApplication.m:2129)
28 UIKit 0x22a23c18 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1636 (UIApplication.m:3625)
29 UIKit 0x22a367c0 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3149 + 36 (UIApplication.m:10365)
30 UIKit 0x22a21356 -[UIApplication workspaceDidEndTransaction:] + 138 (UIApplication.m:2989)
31 FrontBoardServices 0x1ee5cc0e __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 14 (FBSSerialQueue.m:158)
32 FrontBoardServices 0x1ee5cac8 -[FBSSerialQueue _performNext] + 216 (FBSSerialQueue.m:177)
33 FrontBoardServices 0x1ee5cdb2 -[FBSSerialQueue _performNextFromRunLoopSource] + 40 (FBSSerialQueue.m:206)
34 CoreFoundation 0x1d537fd8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8 (CFRunLoop.c:1941)
35 CoreFoundation 0x1d537b00 __CFRunLoopDoSources0 + 420 (CFRunLoop.c:1989)
36 CoreFoundation 0x1d535f4c __CFRunLoopRun + 1156 (CFRunLoop.c:2821)
37 CoreFoundation 0x1d4891aa CFRunLoopRunSpecific + 466 (CFRunLoop.c:3113)
38 CoreFoundation 0x1d488fcc CFRunLoopRunInMode + 100 (CFRunLoop.c:3143)
39 UIKit 0x22816e28 -[UIApplication _run] + 656 (UIApplication.m:2658)
40 UIKit 0x22811a4e UIApplicationMain + 146 (UIApplication.m:4089)
41 MyApp 0x68564 main + 32 (HighlightsDetailViewController.swift:62)
42 libdyld.dylib 0x1cc764e6 _dyld_process_info_notify_release + 26 (dyld_process_info_notify.cpp:327)
Thanks in advance!
I finally solved the problem. Shortly, the crash appeared only on iOS 10.x devices, because some of my .xib files had had set a later version of iOS (11.0 i.e.) in "File Inspector -> Interface Builder Document -> Builds for" instead of the default Deployment Target set in the project settings, which was 10.x of course.

Resources