Unable to simultaneously satisfy constraints, where is it coming from? - ios

I have this warning when building my app. I'm using a storyboard, but all constraints are proper over there.. I don't know where else I have to look..
2014-04-29 14:18:54.072 gTicket[1540:60b] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x16593a90 V:[UIView:0x165a1dd0(429)]>",
"<NSLayoutConstraint:0x165b3c50 V:[UILabel:0x165b3d80(20)]>",
"<NSLayoutConstraint:0x165b37c0 V:[UIView:0x165945a0(52)]>",
"<NSLayoutConstraint:0x165ac960 V:[_UILayoutGuide:0x165a8670]-(36)-[UIView:0x165a1dd0]>",
"<NSLayoutConstraint:0x165a9060 V:[UIView:0x165a1dd0]-(14)-[UILabel:0x165b3d80]>",
"<NSLayoutConstraint:0x165b50d0 V:[UILabel:0x165b3d80]-(16)-[UIView:0x165945a0]>",
"<NSLayoutConstraint:0x165a1e80 V:[UIView:0x165945a0]-(1)-[_UILayoutGuide:0x165adfc0]>",
"<_UILayoutSupportConstraint:0x165adf00 V:[_UILayoutGuide:0x165a8670(0)]>",
"<_UILayoutSupportConstraint:0x165ae3b0 V:|-(0)-[_UILayoutGuide:0x165a8670] (Names: '|':UIView:0x165a6940 )>",
"<_UILayoutSupportConstraint:0x1659c120 V:[_UILayoutGuide:0x165adfc0(0)]>",
"<_UILayoutSupportConstraint:0x165a12d0 _UILayoutGuide:0x165adfc0.bottom == UIView:0x165a6940.bottom>",
"<NSAutoresizingMaskLayoutConstraint:0x165baf00 h=--& v=--& V:[UIView:0x165a6940(431)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x16593a90 V:[UIView:0x165a1dd0(429)]>
Is it possible to determine which UILabel and which view it is complaining about?

Related

Unable to simultaneously satisfy constraints.

Can anybody help me understanding this Autolayout exception?
Probably at least one of the constraints in the following list is one you don't want. Try this:
(1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the
UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7f9b3c030f30 H:[UIImageView:0x7f9b3c042530(80)]>",
"<NSLayoutConstraint:0x7f9b3c04c980 UIImageView:0x7f9b3c042530.leading == UIView:0x7f9b39ef83e0.leadingMargin - 8>",
"<NSLayoutConstraint:0x7f9b3c03be80 H:[UIImageView:0x7f9b3c042530]-(8)-[UILabel:0x7f9b3c03c520'Distance']>",
"<NSLayoutConstraint:0x7f9b39ef6d30 H:[UILabel:0x7f9b3c03c520'Distance']-(9)-[UILabel:0x7f9b3c03c330'Hip Hop']>",
"<NSLayoutConstraint:0x7f9b39ecdf60 UILabel:0x7f9b3c03c330'Hip Hop'.width == UILabel:0x7f9b39eef850'Price'.width>",
"<NSLayoutConstraint:0x7f9b39ecdfb0 UILabel:0x7f9b3c03c330'Hip Hop'.width == UILabel:0x7f9b3c03c520'Distance'.width>",
"<NSLayoutConstraint:0x7f9b39eed730 H:[UILabel:0x7f9b3c03c330'Hip Hop']-(9)-[UILabel:0x7f9b39eef850'Price']>",
"<NSLayoutConstraint:0x7f9b39eed780 UIView:0x7f9b39ef83e0.trailingMargin == UILabel:0x7f9b39eef850'Price'.trailing - 3>",
"<NSAutoresizingMaskLayoutConstraint:0x7f9b39edf060 h=--& v=--& H:[UIView:0x7f9b39ef83e0(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9b3c030f30 H:[UIImageView:0x7f9b3c042530(80)]>
Help Appreciated.
Whatever the view is that you're adding in code you should add the line...
imageView.translatesAutoresizingMaskIntoConstraints = NO;

Unable to simultaneously satisfy constraints. Leading and Trailing constraints conflicts

Can somebody help me understand these errors and and suggest how to go about solving them?
2014-09-19 08:52:45.812 Zazzle[23292:1834589] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7c0ba1e0 H:|-(8)-[UIView:0x7c0bb900] (Names: '|':UIView:0x7c0b6c20 )>",
"<NSLayoutConstraint:0x7c0ba210 H:[UIView:0x7c0bb900]-(8)-| (Names: '|':UIView:0x7c0b6c20 )>",
"<NSLayoutConstraint:0x7c0942e0 UIView:0x7c0b6c20.left == UIView:0x7c0bbfa0.left>",
"<NSLayoutConstraint:0x7c0c03e0 UIView:0x7c0b6c20.right == UIView:0x7c0bbfa0.right>",
"<NSLayoutConstraint:0x7c635250 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7c0bbfa0(2)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7c0ba210 H:[UIView:0x7c0bb900]-(8)-| (Names: '|':UIView:0x7c0b6c20 )>
fromFollow the below steps
Check the constraints of a UiObject and remove any constraints that duplicated, from size inspector of Xcode.
If there is no duplication,find out exact constraint that cause the problem
Try to change the priority of constraint from default required(1000) to high(750).
The conflict is right there: the first two constraints set the subview's leading and trailing values to be 8 pixels away from the containing view controller's left and right edges, while the third and fourth lines set them to be exactly even with the containing view's edges. Remove one pair or the other, or, as #dasdom said, lower the priorities of one of the constraint pairs.

How can I detect the views whose constraints are being unsatisfied?

I am constantly getting this error:
2014-09-13 23:56:19.904 Parrot[245:60b] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x14641170 H:[UILabel:0x14641060(200)]>",
"<NSLayoutConstraint:0x14643670 H:[UILabel:0x14641060]-(60)-| (Names: '|':UIView:0x14641590 )>",
"<NSLayoutConstraint:0x146436a0 H:|-(60)-[UILabel:0x14641060] (Names: '|':UIView:0x14641590 )>",
"<NSAutoresizingMaskLayoutConstraint:0x1464bc70 h=--& v=--& H:[UIView:0x14641590(480)]>"
)
How can I detect the views whose constraints are being unsatisfied?
[UILabel:0x14641060]
It's in error message.
It seems this UILabel has three constraints. Remove any one of these you can satisfy the constraints

iOS: Unable to simultaneously satisfy constraints

I've seen the common response to this question of not having constraints set up properly. However, I've worked through all of the ambiguities in Interface Builder, and all constraints seem OK. I'm not sure what to check next. I can't even tell where it is coming from. I'm not setting any constraints in code.
What can I do to figure out where it is coming form?
What can be the cause if Interface Builder doesn't report any ambiguities?
Here's the specific error:
2014-06-28 19:54:36.070 Prayer Feed[4497:60b] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x178290360 H:[UIImageView:0x13ee32490(20)]>",
"<NSLayoutConstraint:0x1782904f0 UITableViewCellContentView:0x178166840.centerX == UIImageView:0x13ee32490.centerX + 62>",
"<NSLayoutConstraint:0x178290540 H:|-(52)-[UIImageView:0x13ee32490] (Names: '|':UITableViewCellContentView:0x178166840 )>",
"<NSAutoresizingMaskLayoutConstraint:0x170286d60 h=--& v=--& H:[UITableViewCellContentView:0x178166840(247)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x178290360 H:[UIImageView:0x13ee32490(20)]>
I know the two place in code where I have a UIImageView constrained to 20x20, but again, IB tells me everything is fine.
This is the part where the problem is:
<NSAutoresizingMaskLayoutConstraint:0x170286d60 h=--& v=--& H:[UITableViewCellContentView:0x178166840(247)]>
This mask needs to be turned off.
I think that mask is off by default for IB elements that have constraints. So I assume you made something in code. You can turn it off in code like this:
contentView.translatesAutoresizingMaskIntoConstraints = NO
If this is really all IB only then I would like to know what code you use around creating table cells.

Autolayout Constraint Error

I have a problem with autolayout contraints on my iPad project, when I rotate my device I have this error :
2013-06-03 13:16:24.969 PDFViewer[7534:907] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x1f5525e0 H:[UIScrollView:0x1f551910]-(970)-| (Names: '|':UIView:0x1f547740 )>",
"<NSLayoutConstraint:0x1f5525a0 H:|-(0)-[UIScrollView:0x1f551910] (Names: '|':UIView:0x1f547740 )>",
"<NSAutoresizingMaskLayoutConstraint:0x1f562520 h=--- v=--- H:[UIWindow:0x1f543890(768)]>",
"<NSAutoresizingMaskLayoutConstraint:0x1f560af0 h=-&- v=-&- UIView:0x1f547740.width == UIWindow:0x1f543890.width>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1f5525e0 H:[UIScrollView:0x1f551910]-(970)-| (Names: '|':UIView:0x1f547740 )>
Ok, some constraints are contentious but I don't set any constraint by myself, they are all set automatically in Interface Builder and I can't remove them. What I want is pretty simple, a scrollview, with fixed width and 100% height, and a collection view, with remaining width and 100% height.
Autolayout makes me crazy, any idea ?
Edit : Here are my constraints defined in IB
Error was caused by an automatic constraint, more precisely this one :
"<NSLayoutConstraint:0x1f5525e0 H:[UIScrollView:0x1f551910]-(970)-| (Names: '|':UIView:0x1f547740 )>",
As it is added by IB you can't delete it, so for ignoring it I have set the priority to 1.

Resources