Swift - hierarchy constraint issues and debugging

99 Views Asked by At

I'm new to swift and am finding debugging to be particularly difficult. I"m using RubyMotion if that is relevant. After I log out a user and try to log back in I receive the following log:

2017-04-20 13:56:54.810 nav[8614:3232848] *** Assertion failure in -[UIView _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.6.21/NSLayoutConstraint_UIKitAdditions.m:649
2017-04-20 13:56:54.927 nav[8614:3232848] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Impossible to set up layout with view hierarchy unprepared for constraint.'
*** First throw call stack:
(
0   CoreFoundation                      0x0000000102ab5d4b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x000000010141421e objc_exception_throw + 48
2   CoreFoundation                      0x0000000102ab9e42 +[NSException raise:format:arguments:] + 98
3   Foundation                          0x00000001038d466d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4   UIKit                               0x0000000105a4d57b __120-[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:]_block_invoke_2 + 206
5   UIKit                               0x0000000105a4d417 -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 418
6   UIKit                               0x0000000105a4d7e8 -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] + 30
7   UIKit                               0x0000000105a4d8fa -[UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 221
8   UIKit                               0x0000000105a4dc0e __50-[UIView(UIConstraintBasedLayout) addConstraints:]_block_invoke + 208
9   Foundation                          0x000000010385a3b0 -[NSISEngine withBehaviors:performModifications:] + 155
10  UIKit                               0x0000000105a4db2f -[UIView(UIConstraintBasedLayout) addConstraints:] + 277
11  nav                                 0x00000001000d2ae2 __unnamed_64 + 98
12  nav                                 0x00000001004b495c vm_dispatch + 1372
13  nav                                 0x00000001004b8511 rb_scope__strain__ + 1313
14  nav                                 0x00000001009d9135 rb_vm_dispatch + 7221
15  nav                                 0x00000001004b495c vm_dispatch + 1372
16  nav                                 0x00000001004b7a3e rb_scope__initialize__ + 238
17  nav                                 0x00000001009d9135 rb_vm_dispatch + 7221
18  nav                                 0x000000010092ec57 rb_class_new_instance0 + 855
19  nav                                 0x00000001009d86e6 rb_vm_dispatch + 4582
20  nav                                 0x000000010076c1ec vm_dispatch + 1372
21  nav                                 0x0000000100780bc3 rb_scope__main_layout__ + 275
22  nav                                 0x00000001009d9135 rb_vm_dispatch + 7221
23  nav                                 0x000000010076c1ec vm_dispatch + 1372
24  nav                                 0x0000000100777955 rb_scope__layout__ + 133
25  nav                                 0x00000001009d9135 rb_vm_dispatch + 7221
26  nav                                 0x000000010076c1ec vm_dispatch + 1372
27  nav                                 0x0000000100778496 rb_scope__viewDidLoad__ + 534
28  nav                                 0x00000001007784ed __unnamed_67 + 13
29  UIKit                               0x000000010522aa3d -[UIViewController loadViewIfRequired] + 1258
30  UIKit                               0x0000000105231062 -[UIViewController __viewWillAppear:] + 118
31  UIKit                               0x000000010525c1d3 -[UINavigationController _startCustomTransition:] + 1290
32  UIKit                               0x000000010526ce48 -[UINavigationController _startDeferredTransitionIfNeeded:] + 697
33  UIKit                               0x000000010526dfdb -[UINavigationController __viewWillLayoutSubviews] + 58
34  UIKit                               0x0000000105464dd7 -[UILayoutContainerView layoutSubviews] + 223
35  UIKit                               0x000000010514dab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
36  QuartzCore                          0x0000000104b4ebf8 -[CALayer layoutSublayers] + 146
37  QuartzCore                          0x0000000104b42440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
38  QuartzCore                          0x0000000104b422be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
39  QuartzCore                          0x0000000104ad0318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
40  QuartzCore                          0x0000000104afd3ff _ZN2CA11Transaction6commitEv + 475
41  QuartzCore                          0x0000000104afdd6f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
42  CoreFoundation                      0x0000000102a5a267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
43  CoreFoundation                      0x0000000102a5a1d7 __CFRunLoopDoObservers + 391
44  CoreFoundation                      0x0000000102a3ef8e __CFRunLoopRun + 1198
45  CoreFoundation                      0x0000000102a3e884 CFRunLoopRunSpecific + 420
46  GraphicsServices                    0x0000000107e57a6f GSEventRunModal + 161
47  UIKit                               0x0000000105088c68 UIApplicationMain + 159
48  nav                                 0x00000001000a9fd2 main + 146
49  libdyld.dylib                       0x0000000106f1b68d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

What I'm struggling with is trying to find out where the error is in my code from the error logs.

Perhaps I'm spoiled but in ruby I'm used to a filename and line number being given where the error has been caused - is this something I can find out from this log?

Thanks in advance.

0

There are 0 best solutions below