Search code examples
iosnslayoutconstraint

Unable to simultaneously satisfy constraints error makes the screen flickers in IOS 9


I am getting following log in my console in XCode.

2016-10-12 16:48:13.218 xx[319:19209] 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. 
(
"<NSLayoutConstraint:0x16c610c0 H:[JTImageButton:0x16c61120'\Ufffc(null)'(130)]>",
"<NSLayoutConstraint:0x16be02a0 '_UITemporaryLayoutWidth' H:[JTImageButton:0x16c61120'\Ufffc(null)'(1000)]>"
)

Will attempt to recover by breaking constraint 

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

And my screen flickers when this log happens.

How can I solve that?


Solution

  • You are giving your JTImageButton a horizontal size of 130 and after that you are defining another constraint that set is horizontal size to 1000. Remove 1 of those constraints. You cannot define multiple size constraints for the same axis.