Skip to content

Instantly share code, notes, and snippets.

@dcloud
Created January 28, 2014 18:14
Show Gist options
  • Save dcloud/8673094 to your computer and use it in GitHub Desktop.
Save dcloud/8673094 to your computer and use it in GitHub Desktop.
mapbox upgrade creates autolayout issue
0xcc7ab20 V:[UIImageView:0xe1d0b00]-(3)-[_UILayoutGuide:0xcc9a270]>
When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.
2014-01-28 13:09:02.400 Congress[15314:70b] View hierarchy unprepared for constraint.
Constraint: <NSLayoutConstraint:0xcc7ab20 V:[UIImageView:0xe1d0b00]-(3)-[_UILayoutGuide:0xcc9a270]>
Container hierarchy:
MapView at {0,0}-{320x548}
| <RMLoadingTileView: 0xe1ccec0; baseClass = UIScrollView; frame = (0 0; 320 548); clipsToBounds = YES; userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0xe1cd380>; layer = <CALayer: 0xe1cd100>; contentOffset: {320, 548}>
| | <UIView: 0xe1cd550; frame = (0 0; 960 1644); layer = <CALayer: 0xe1cd5b0>>
| <RMMapScrollView: 0xcf51b90; baseClass = UIScrollView; frame = (0 0; 320 548); opaque = NO; gestureRecognizers = <NSArray: 0xcf4ef20>; layer = <CALayer: 0xcf4f600>; contentOffset: {4527, 5993}>
| | <UIView: 0xcf4fac0; frame = (0 0; 16384 16384); transform = [64, 0, 0, 64, 0, 0]; userInteractionEnabled = NO; layer = <CALayer: 0xcf4fb20>>
| | | <RMMapTiledLayerView: 0xcf50d70; frame = (0 0; 256 256); opaque = NO; layer = <CATiledLayer: 0xcf50de0>>
| <RMMapOverlayView: 0xcf4b3b0; frame = (0 0; 320 548); userInteractionEnabled = NO; layer = <CAScrollLayer: 0xcf4ace0>>
| <UIView: 0xe1d8b00; frame = (-360 5; 0 0); layer = <CALayer: 0xe1d9370>>
| | <UIButton: 0xe1d8220; frame = (0 0; 36 36); alpha = 0; opaque = NO; layer = <CALayer: 0xe1d98d0>>
| | | <UIImageView: 0xcc961c0; frame = (0 0; 36 36); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xccb4780>> - (null)
| <SSLineView: 0xe1d9b30; frame = (0 0; 320 1); opaque = NO; autoresize = W; layer = <CALayer: 0xe1d9610>>
| <SSLineView: 0xcf4bb70; frame = (0 0; 320 1); opaque = NO; autoresize = W; layer = <CALayer: 0xcf565a0>>
| <_UILayoutGuide: 0xcc96250; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0xccb6b60>>
| <_UILayoutGuide: 0xcc9a270; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0xcc9a2e0>>
View not found in container hierarchy: <UIImageView: 0xe1d0b00; frame = (8 -25; 80 22); opaque = NO; autoresize = RM+TM; userInteractionEnabled = NO; layer = <CALayer: 0xe1d45b0>> - (null)
That view's superview: NO SUPERVIEW
2014-01-28 13:09:02.415 Congress[15314:70b] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That's illegal. constraint:<NSLayoutConstraint:0xcc7ab20 V:[UIImageView:0xe1d0b00]-(3)-[_UILayoutGuide:0xcc9a270]> view:MapView at {0,0}-{320x548}'
*** First throw call stack:
(
0 CoreFoundation 0x03a725e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x033748b6 objc_exception_throw + 44
2 CoreFoundation 0x03a723bb +[NSException raise:format:] + 139
3 Foundation 0x0147909f -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 197
4 UIKit 0x0240b5fd -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 451
5 UIKit 0x0240b7dd -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] + 61
6 UIKit 0x0240b92c -[UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 275
7 UIKit 0x0240baf1 -[UIView(UIConstraintBasedLayout) _addConstraint:] + 233
8 UIKit 0x0240ba03 -[UIView(UIConstraintBasedLayout) addConstraint:] + 40
9 UIKit 0x0240bcce __50-[UIView(UIConstraintBasedLayout) addConstraints:]_block_invoke + 172
10 Foundation 0x015f338c -[NSISEngine withBehaviors:performModifications:] + 107
11 Foundation 0x01482f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
12 UIKit 0x0240b1ad -[UIView(UIConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 63
13 UIKit 0x0240bc1a -[UIView(UIConstraintBasedLayout) addConstraints:] + 289
14 Congress 0x002435d3 -[RMMapView updateConstraints] + 4275
15 UIKit 0x01ec8661 -[UIViewController updateViewConstraints] + 42
16 UIKit 0x02416348 -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 239
17 UIKit 0x024164c6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
18 UIKit 0x02416447 __UIViewRecursionHelper + 40
19 CoreFoundation 0x03a13d59 CFArrayApplyFunction + 57
20 UIKit 0x024162ec -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
21 UIKit 0x024164c6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
22 UIKit 0x02416447 __UIViewRecursionHelper + 40
23 CoreFoundation 0x03a13d59 CFArrayApplyFunction + 57
24 UIKit 0x024162ec -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
25 UIKit 0x024164c6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
26 UIKit 0x02416936 __60-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded]_block_invoke + 43
27 Foundation 0x015f338c -[NSISEngine withBehaviors:performModifications:] + 107
28 Foundation 0x01482f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
29 UIKit 0x02416130 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
30 UIKit 0x02416666 -[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 178
31 Congress 0x0002b031 -[SFLegislatorDetailViewController updateView] + 4817
32 Congress 0x00028adc -[SFLegislatorDetailViewController setLegislator:] + 2284
33 Congress 0x000984a4 -[SFLegislatorSegmentedViewController setLegislator:] + 132
34 Congress 0x0009829f __67-[SFLegislatorSegmentedViewController setLegislatorWithBioguideId:]_block_invoke + 127
35 Congress 0x0000a78c __56+[SFLegislatorService legislatorWithId:completionBlock:]_block_invoke + 204
36 Congress 0x00190d07 __55-[AFHTTPSessionManager GET:parameters:success:failure:]_block_invoke + 231
37 Congress 0x001b5d75 __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_288 + 213
38 libdispatch.dylib 0x03d0c7f8 _dispatch_call_block_and_release + 15
39 libdispatch.dylib 0x03d214b0 _dispatch_client_callout + 14
40 libdispatch.dylib 0x03d0f75e _dispatch_main_queue_callback_4CF + 340
41 CoreFoundation 0x03ad7a5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
42 CoreFoundation 0x03a186bb __CFRunLoopRun + 1963
43 CoreFoundation 0x03a17ac3 CFRunLoopRunSpecific + 467
44 CoreFoundation 0x03a178db CFRunLoopRunInMode + 123
45 GraphicsServices 0x04a959e2 GSEventRunModal + 192
46 GraphicsServices 0x04a95809 GSEventRun + 104
47 UIKit 0x01db0d3b UIApplicationMain + 1225
48 Congress 0x000091cd main + 141
49 libdyld.dylib 0x03fb370d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@mkll
Copy link

mkll commented Feb 24, 2014

Try to set mapView.showLogoBug = YES;
It helped me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment