Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unsupported style: 4' - ios

I'm using this code to create top right bar button and perform a action in ios objective C.
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:#selector(addAppliance)];
self.navigationItem.rightBarButtonItem = anotherButton;
But showing this error
Terminating app due to uncaught exception 'NSInternalInconsistencyException',`reason: 'Unsupported style: 4'
First throw call stack:
(
0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e3cc88
+[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff258b8bd2
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
+ 191
4 UIKitCore
0x00007fff48d70f87 +[_UIBarButtonItemData standardItemDataForStyle:]
+ 539
5 UIKitCore
0x00007fff4828b26f -[_UIButtonBarButtonVisualProviderIOS _
computeTextAttributes] + 216
6 UIKitCore
0x00007fff4828b173 -[_UIButtonBarButtonVisual
ProviderIOS _computeTextAttributesForBarButtonItem:]
+ 371
7 UIKitCore
0x00007fff4828eef7 -[_UIButtonBarButtonVisual
ProviderIOS configureButton:fromBarButtonItem:] + 223
8 UIKitCore
0x00007fff4828ce8d -[_UIButtonBarButtonVisual
ProviderIOS configureButton:withAppearanceDelegate:fromBarItem:]
+ 114
9 UIKitCore
0x00007fff4828796f -
[_UIButtonBarButton _configureFromBarItem:appearanceDelegate
:isBackButton:] + 83
10 UIKitCore
0x00007fff4828750b -[_UIButtonBarButton configureFromBarItem:withAppearanceDelegate:] + 53
11 UIKitCore
0x00007fff48283a27 -[_UIButtonBar _updatedViewForBarButtonItem:withView:]
+ 456
12 UIKitCore
0x00007fff48281d02 __32-[_UIButtonBar _newGroupLayout:]_block_invoke + 82
13 UIKitCore
0x00007fff48291708 -[_UIButtonBarItemLayout _updateItemView] + 53
14 UIKitCore
0x00007fff48291ce9 -[_UIButtonBarItemLayout _configure] + 39
15 UIKitCore
0x00007fff482907a5 -[_UIButtonBarLayout configure] + 51
16 UIKitCore
0x00007fff48290908 -[_UIButtonBarLayout addLayoutViews:] + 49
17 UIKitCore
0x00007fff48293dd3 -[_UIButtonBarItemGroupLayout _iterateConfiguredLayouts:]
+ 228
18 UIKitCore
0x00007fff48293eaf -[_UIButtonBarItemGroupLayout _addLayoutViews:]
+ 111
19 UIKitCore
0x00007fff4829086c -
[_UIButtonBarLayout
addLayoutViews:layoutGuides:constraintsToActivate:
constraintsToDeactivate:] + 111
20 UIKitCore 0x00007fff48282424 -[_UIButtonBar _layoutBar] + 1768
21 UIKitCore 0x00007fff4828637e -[_UIButtonBarStackView updateConstraints] + 48
22 UIKitCore 0x00007fff490b0afa -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 489
23 UIKitCore 0x00007fff490b10c8 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 1187
24 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
25 Foundation 0x00007fff25aa5778 -[NSISEngine withBehaviors:performModifications:] + 84
26 UIKitCore 0x00007fff490b186a __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 85
27 UIKitCore 0x00007fff490b0077 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
28 UIKitCore 0x00007fff490b13c5 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 154
29 UIKitCore 0x00007fff490b22e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 393
30 UIKitCore 0x00007fff4917e9f1 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1334
31 UIKitCore 0x00007fff4830a32d -[_UINavigationBarTransitionContextPush _prepareContentView] + 204
32 UIKitCore 0x00007fff4830c36d -[_UINavigationBarTransitionContextPush prepare] + 106
33 UIKitCore 0x00007fff4831bd7c -[_UINavigationBarVisualProviderModernIOS _performAnimationWithTransitionCompletion:transition:] + 2221
34 UIKitCore 0x00007fff482bd813 -[UINavigationBar _pushNavigationItem:transitionAssistant:] + 568
35 UIKitCore 0x00007fff482bcf76 -[UINavigationBar _pushNavigationItemUsingCurrentTransition:] + 366
36 UIKitCore 0x00007fff482bd0e2 -[UINavigationBar pushNavigationItem:animated:] + 179
37 UIKitCore 0x00007fff482b7523 -[UINavigationBar _performUpdatesIgnoringLock:] + 45
38 UIKitCore 0x00007fff482bd1d9 -[UINavigationBar _pushNavigationItem:transition:] + 133
39 UIKitCore 0x00007fff48549776 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 457
40 UIKitCore 0x00007fff485498ed __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke.1801 + 114
41 UIKitCore 0x00007fff48544c46 __98-[UINavigationController _shouldSkipHostedRefreshControlUpdateSchedulingDeferredUpdateIfNecessary]_block_invoke + 16
42 UIKitCore 0x00007fff485467ef -[UINavigationController _startDeferredTransitionIfNeeded:] + 1348
43 UIKitCore 0x00007fff48547954 -[UINavigationController __viewWillLayoutSubviews] + 150
44 UIKitCore 0x00007fff48528924 -[UILayoutContainerView layoutSubviews] + 217
45 UIKitCore 0x00007fff49193678 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478
46 QuartzCore 0x00007fff2b4c6398 -[CALayer layoutSublayers] + 255
47 QuartzCore 0x00007fff2b4cc523 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523
48 QuartzCore 0x00007fff2b4d7bba _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80
49 QuartzCore 0x00007fff2b420c04 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324
50 QuartzCore 0x00007fff2b4545ef _ZN2CA11Transaction6commitEv + 649
51 UIKitCore 0x00007fff48c84fc8 _UIApplicationFlushRunLoopCATransactionIfTooLate + 104
52 UIKitCore 0x00007fff48d32ab0 __handleEventQueueInternal + 7506
53 UIKitCore 0x00007fff48d28fb9 __handleHIDEventFetcherDrain + 88
54 CoreFoundation 0x00007fff23da0d31 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17
55 CoreFoundation 0x00007fff23da0c5c __CFRunLoopDoSource0 + 76
56 CoreFoundation 0x00007fff23da0434 __CFRunLoopDoSources0 + 180
57 CoreFoundation 0x00007fff23d9b02e __CFRunLoopRun + 974
58 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
59 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
60 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
61 GasChecker 0x000000010099e5b7 main + 55
62 libdyld.dylib 0x00007fff51a231fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Related

WKWebView App crash when press "Shift" using Hardware KeyBoard iOS Swift

I'm using WKWebView, when I try to insert any values in WebPage using HardWare KeyBoard app getting crashed. It's always crashing when i Press Shift + Any Other Key with my External KeyBoard.
Note:- i already tried webview.keyboardDisplayRequiresUserAction with true and false both
I already tried with following solutions but won't work for me
WKWebView crashes if user answers an incoming iMessage.
WKWebview with the new iOS13 modal crash when a file picker is invoked.
iOS11 WKWebview crash due to NSInvalidUnarchiveOperationException
Crash Log
2021-04-14 19:05:25.253969+0530 ZapDial[13417:318028] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff512a19b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23ed09d1 _CFThrowFormattedException + 194
3 CoreFoundation 0x00007fff23edb426 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38
4 CoreFoundation 0x00007fff23e9c6e7 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247
5 CoreFoundation 0x00007fff23e39d71 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
6 UIAccessibility 0x00007fff4877c634 AXUIAutomationHandleKeyComplete + 200
7 WebKitLegacy 0x000000011c197592 sendNotificationAfterHandlingWebKeyEventIfNeeded + 144
8 WebKitLegacy 0x000000011c1974ee -[DOMNodeAccessibility handleKeyWebEvent:] + 72
9 CoreFoundation 0x00007fff23e44dec __invoking___ + 140
10 CoreFoundation 0x00007fff23e41fd1 -[NSInvocation invoke] + 321
11 CoreFoundation 0x00007fff23e422a4 -[NSInvocation invokeWithTarget:] + 68
12 UIKitCore 0x00007fff498c7b79 -[UIThreadSafeNode forwardInvocation:] + 92
13 CoreFoundation 0x00007fff23e42616 ___forwarding___ + 838
14 CoreFoundation 0x00007fff23e44b58 _CF_forwarding_prep_0 + 120
15 UIKitCore 0x00007fff49192ccb -[UIKeyboardImpl _handleWebKeyEvent:withEventType:withInputString:withInputStringIgnoringModifiers:executionContext:] + 635
16 UIKitCore 0x00007fff49194b14 -[UIKeyboardImpl handleModifiersChangeForKeyEvent:executionContext:] + 528
17 UIKitCore 0x00007fff491a965d -[UIKeyboardTaskEntry execute:] + 147
18 UIKitCore 0x00007fff491a8173 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 310
19 UIKitCore 0x00007fff49193ec6 -[UIKeyboardImpl handleKeyEvent:] + 201
20 CoreFoundation 0x00007fff23e44dec __invoking___ + 140
21 CoreFoundation 0x00007fff23e41fd1 -[NSInvocation invoke] + 321
22 UIKitCore 0x00007fff4971d9a1 -[UIRepeatedAction invoke] + 278
23 UIKitCore 0x00007fff4971dba1 -[UIRepeatedAction _preInvocationTimerFire] + 45
24 UIKitCore 0x00007fff4938d523 -[UIApplication _handleKeyboardPressEvent:] + 2214
25 UIKitCore 0x00007fff49377487 -[UIApplication pressesBegan:withEvent:] + 401
26 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
27 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
28 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
29 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
30 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
31 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
32 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
33 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
34 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
35 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
36 UIKitCore 0x00007fff48bf7489 -[UITabBarController pressesBegan:withEvent:] + 115
37 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
38 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
39 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
40 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
41 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
42 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
43 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
44 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
45 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
46 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
47 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
48 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
49 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
50 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
51 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
52 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
53 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
54 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
55 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
56 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
57 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
58 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
59 UIKitCore 0x00007fff493a045a forwardTouchMethod + 323
60 UIKitCore 0x00007fff493a4182 -[UIResponder pressesBegan:withEvent:] + 49
61 UIKitCore 0x00007fff493afde8 -[UIWindow _sendButtonsForEvent:] + 393
62 UIKitCore 0x00007fff493b0dbd -[UIWindow sendEvent:] + 3273
63 UIKitCore 0x00007fff4938b6cd -[UIApplication sendEvent:] + 356
64 UIKit 0x00000001140260b8 -[UIApplicationAccessibility sendEvent:] + 85
65 UIKitCore 0x00007fff4938c356 -[UIApplication _handleKeyUIEvent:] + 627
66 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
67 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
68 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
69 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
70 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
71 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
72 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
73 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
74 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
75 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
76 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
77 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
78 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
79 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
80 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
81 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
82 UIKitCore 0x00007fff493a3705 -[UIResponder _handleKeyUIEvent:] + 79
83 UIKitCore 0x00007fff4938c402 -[UIApplication handleKeyUIEvent:] + 79
84 UIKitCore 0x00007fff4938c0c2 -[UIApplication handleKeyHIDEvent:] + 535
85 UIKit 0x000000011401fb05 -[UIApplicationAccessibility handleKeyHIDEvent:] + 41
86 UIKitCore 0x00007fff49415781 __dispatchPreprocessedEventFromEventQueue + 4227
87 UIKitCore 0x00007fff4941968e __handleEventQueueInternal + 6584
88 UIKitCore 0x00007fff4940ff31 __handleHIDEventFetcherDrain + 88
89 CoreFoundation 0x00007fff23da1c91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
90 CoreFoundation 0x00007fff23da1bbc __CFRunLoopDoSource0 + 76
91 CoreFoundation 0x00007fff23da1394 __CFRunLoopDoSources0 + 180
92 CoreFoundation 0x00007fff23d9bf8e __CFRunLoopRun + 974
93 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
94 GraphicsServices 0x00007fff38c05bbe GSEventRunModal + 139
95 UIKitCore 0x00007fff49372964 UIApplicationMain + 1605
96 ZapDial 0x000000010c7fab2b main + 75
97 libdyld.dylib 0x00007fff5211c1fd start + 1
98 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

'NSInvalidArgumentException', reason: 'index out of bounds for arranged subview: ...' with UIButtonBar involved

I hope someone is able to help me out here. For a weeks I am seeing this exception in my app:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'index out of bounds for arranged subview: index = 5 expected to be less than or equal to 4'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e3cd4c +[NSException raise:format:] + 188
3 UIKitCore 0x00007fff49095fa8 -[UIStackView insertArrangedSubview:atIndex:] + 161
4 UIKitCore 0x00007fff48282ac1 -[_UIButtonBar _layoutBar] + 3461
5 UIKitCore 0x00007fff4828637e -[_UIButtonBarStackView updateConstraints] + 48
6 UIKitCore 0x00007fff490b0afa -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 489
7 UIKitCore 0x00007fff490b10c8 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 1187
8 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
9 Foundation 0x00007fff25aa5778 -[NSISEngine withBehaviors:performModifications:] + 84
10 UIKitCore 0x00007fff490b12de -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 112
11 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
12 Foundation 0x00007fff25aa5778 -[NSISEngine withBehaviors:performModifications:] + 84
13 UIKitCore 0x00007fff490b12de -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 112
14 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
15 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
16 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
17 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
18 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
19 Foundation 0x00007fff25aa5778 -[NSISEngine withBehaviors:performModifications:] + 84
20 UIKitCore 0x00007fff490b12de -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 112
21 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
22 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
23 UIKitCore 0x00007fff490b0f62 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 829
24 Foundation 0x00007fff25aa5778 -[NSISEngine withBehaviors:performModifications:] + 84
25 UIKitCore 0x00007fff490b186a __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 85
26 UIKitCore 0x00007fff490b0077 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
27 UIKitCore 0x00007fff490b13c5 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 154
28 UIKitCore 0x00007fff490a1390 -[UIWindow(UIConstraintBasedLayout) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 92
29 UIKitCore 0x00007fff490b22e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 393
30 UIKitCore 0x00007fff4917f21b -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 272
31 UIKitCore 0x00007fff49193678 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478
32 QuartzCore 0x00007fff2b4c6398 -[CALayer layoutSublayers] + 255
33 QuartzCore 0x00007fff2b4cc523 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523
34 QuartzCore 0x00007fff2b4d7bba _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80
35 QuartzCore 0x00007fff2b420c04 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324
36 QuartzCore 0x00007fff2b4545ef _ZN2CA11Transaction6commitEv + 649
37 QuartzCore 0x00007fff2b454f81 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 79
38 CoreFoundation 0x00007fff23da0127 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
39 CoreFoundation 0x00007fff23d9abde __CFRunLoopDoObservers + 430
40 CoreFoundation 0x00007fff23d9b12a __CFRunLoopRun + 1226
41 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
42 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
43 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
44 MyApp 0x00000001012dd63b main + 75
45 libdyld.dylib 0x00007fff51a231fd start + 1
46 ??? 0x0000000000000001 0x0 + 1
)
I can not find out what the root cause it. Because _UIButtonBarStackView is mentioned I assume that it has something to do with a UINavigationBar UIBarButtons. It seems to happen when I dismiss a modally presented UINavigationController, but I am not sure.
It also looks like it started to happen with iOS 13.4.1, because I can't find any crash report with any older version.
Anyone might know what's going on here?
Found out the cause: I was adding the same UIBarButtonItem again to navigationItem.rightBarButtonItems. Apple seems to raise exceptions about that since iOS 13.4.1(-ish).

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.

Resources