Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRobert Ashworth
874 PointsTerminating app due to uncaught excemption
Ok, so I have followed this series to a T so far. Up until this particular lesson the app has loaded, and functioned appropriately. After this lesson, I am getting the following error upon launch of the simulator and hitting the initial "Start Adventure" button:
2017-08-11 21:23:54.154 InteractiveStory[49956:10990021] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors <NSLayoutXAxisAnchor:0x600000273f00 "UIButton:0x7fcc00f1a710'Continue home to Earth'.centerX"> and <NSLayoutXAxisAnchor:0x600000273f80 "UIView:0x7fcc00c005c0.centerX"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.' *** First throw call stack: ( 0 CoreFoundation 0x0000000106869b0b exceptionPreprocess + 171 1 libobjc.A.dylib 0x0000000103bf9141 objc_exception_throw + 48 2 CoreFoundation 0x00000001068d2625 +[NSException raise:format:] + 197 3 Foundation 0x000000010372ad51 _55+[NSLayoutConstraint _addOrRemoveConstraints:activate:]_block_invoke + 65 4 Foundation 0x000000010371b82b -[NSISEngine withBehaviors:performModifications:] + 155 5 Foundation 0x00000001037172fa +[NSLayoutConstraint _addOrRemoveConstraints:activate:] + 420 6 InteractiveStory 0x000000010361677d _TFC16InteractiveStory14PageController22viewWillLayoutSubviewsfT_T + 5373 7 InteractiveStory 0x0000000103616e12 TToFC16InteractiveStory14PageController22viewWillLayoutSubviewsfT_T + 34 8 UIKit 0x000000010418e41f -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 952 9 QuartzCore 0x0000000109633904 -[CALayer layoutSublayers] + 146 10 QuartzCore 0x0000000109627526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370 11 QuartzCore 0x00000001096273a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 12 QuartzCore 0x00000001095b6e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 13 QuartzCore 0x00000001095e3130 _ZN2CA11Transaction6commitEv + 468 14 QuartzCore 0x00000001095e3b37 _ZN2CA11Transaction17observer_callbackEP19CFRunLoopObservermPv + 115 15 CoreFoundation 0x000000010680f717 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 16 CoreFoundation 0x000000010680f687 __CFRunLoopDoObservers + 391 17 CoreFoundation 0x00000001067f4720 __CFRunLoopRun + 1200 18 CoreFoundation 0x00000001067f4016 CFRunLoopRunSpecific + 406 19 GraphicsServices 0x0000000108774a24 GSEventRunModal + 62 20 UIKit 0x00000001040cb134 UIApplicationMain + 159 21 InteractiveStory 0x0000000103612017 main + 55 22 libdyld.dylib 0x000000010780965d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
I've been looking over my code for over an hour now and simply cannot pinpoint what's going on. Any help?
1 Answer
Garrett Votaw
iOS Development Techdegree Graduate 15,223 PointsHey Robert,
I'm not exactly sure what the issue is as I can't see your code but I would look at the constraints for the "continue home to earth button". The error seems to state that the app is unable to activate the constraints for that button. Try modifying your constraints and making sure they are correct.