What are these warnings in my console? - ios

I am having the following error in my console.I don't know what are they.
2015-03-24 13:57:43.213 automobile[5454:530574] 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:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>",
"<NSLayoutConstraint:0x174284740 V:[UIButton:0x12ee424c0'Retry']-(236)-[_UILayoutGuide:0x1741b8f00]>",
"<_UILayoutSupportConstraint:0x1740aeb80 V:[_UILayoutGuide:0x1741b8e20(50.66)]>",
"<_UILayoutSupportConstraint:0x1740aebe0 V:|-(0)-[_UILayoutGuide:0x1741b8e20] (Names: '|':UIView:0x174185bd0 )>",
"<_UILayoutSupportConstraint:0x1740aee80 V:[_UILayoutGuide:0x1741b8f00(0)]>",
"<_UILayoutSupportConstraint:0x1740aee20 _UILayoutGuide:0x1741b8f00.bottom == UIView:0x174185bd0.bottom>",
"<NSLayoutConstraint:0x174289d30 'UIView-Encapsulated-Layout-Height' V:[UIView:0x174185bd0(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>
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.
Anyone who know this?Any Help?

It seems you have conflicting constraints on your views.
If you are using Interface Builder, I suggest your click on the Red or Yellow arrows in your VC scene and Xcode should give you more details as to what constraints are causing the issue.
You can see here http://i.stack.imgur.com/5lbp8.png and here http://i.stack.imgur.com/qjvFL.png how this should appear in Xcode.
I suggest you start by reconsidering the constraints and try to keep the minimum that satisfy your layout.
I hope this helps

Related

Silencing Constraint Warnings in Swift?

I always get this huge constraint warning that clutters my console when I enter a certain view. I realize my constraints are probably off but everything displays the way I want it to without any storyboard or compile-time warnings.
So is there a way to get rid of this big annoying message?
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.
2015-08-05 15:26:27.151[APP][12834:12179015] 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:0x7ffef7529660 H:[UIImageView:0x7ffef75294b0(94)]>",
"<NSLayoutConstraint:0x7ffef752a220 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh'(432)]>",
"<NSLayoutConstraint:0x7ffef752d470 UIImageView:0x7ffef75294b0.leading == UITableViewCellContentView:0x7ffef7529370.leadingMargin>",
"<NSLayoutConstraint:0x7ffef752d790 H:[UIImageView:0x7ffef75294b0]-(NSSpace(8))-[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh']>",
"<NSLayoutConstraint:0x7ffef752dc90 UITableViewCellContentView:0x7ffef7529370.trailingMargin == UILabel:0x7ffef752c180'07/07'.trailing>",
"<NSLayoutConstraint:0x7ffef752dce0 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh']-(NSSpace(8))-[UILabel:0x7ffef752c180'07/07']>",
"<NSLayoutConstraint:0x7ffef75351b0 'fittingSizeHTarget' H:[UITableViewCellContentView:0x7ffef7529370(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7ffef752a220 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh'(432)]>

Locating auto layout constraints errors in the log

I'm getting a bunch of auto layout constraints errors in my log, albeit there's none in my storyboard. I am having trouble understanding most of them especially locating specific views and text fields that are throwing errors:
2015-07-19 20:39:28.625 Daily[42447:417537] 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:0x7fd8a3e309e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7fd8a3dc4ea0(375)]>",
"<NSLayoutConstraint:0x7fd8a3dcc3f0 UIView:0x7fd8a3f416c0.leading == UIView:0x7fd8a3dc4ea0.leadingMargin>",
"<NSLayoutConstraint:0x7fd8a3dcc4e0 UIView:0x7fd8a3dc4ea0.centerX == UIView:0x7fd8a3f416c0.centerX>",
"<NSLayoutConstraint:0x7fd8a3dcc670 V:[UIView:0x7fd8a3f416c0(81)]>",
"<NSLayoutConstraint:0x7fd8a3dcc6c0 UIView:0x7fd8a3f416c0.width == 4.54321*UIView:0x7fd8a3f416c0.height>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fd8a3dcc6c0 UIView:0x7fd8a3f416c0.width == 4.54321*UIView:0x7fd8a3f416c0.height>
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.
2015-07-19 20:39:28.627 Daily[42447:417537] 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:0x7fd8a3e309e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7fd8a3dc4ea0(375)]>",
"<NSLayoutConstraint:0x7fd8a3dcbf20 V:[UIView:0x7fd8a3dc4a50]-(76)-[UIView:0x7fd8a3dcb8b0]>",
"<NSLayoutConstraint:0x7fd8a3dcbfc0 V:[_UILayoutGuide:0x7fd8a3dc4fb0]-(322)-[UIView:0x7fd8a3dcb8b0]>",
"<NSLayoutConstraint:0x7fd8a3dcc010 UIView:0x7fd8a3dc4ea0.width == 3.25203*UIView:0x7fd8a3dc4a50.height>",
"<NSLayoutConstraint:0x7fd8a3dcc100 V:[UIView:0x7fd8a3dcc150]-(34)-[UIView:0x7fd8a3dc4a50]>",
"<NSLayoutConstraint:0x7fd8a3dcc5d0 V:[_UILayoutGuide:0x7fd8a3dc4fb0]-(31)-[UIView:0x7fd8a3dcc150]>",
"<NSLayoutConstraint:0x7fd8a3dcdec0 H:[UIView:0x7fd8a3dcc150(368)]>",
"<NSLayoutConstraint:0x7fd8a3dcdf10 UIView:0x7fd8a3dcc150.width == 6.34483*UIView:0x7fd8a3dcc150.height>"
)
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.
2015-07-19 20:39:28.628 Daily[42447:417537] 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:0x7fd8a3e309e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7fd8a3dc4ea0(375)]>",
"<NSLayoutConstraint:0x7fd8a3dcbed0 UIView:0x7fd8a3dcb8b0.trailing == UIView:0x7fd8a3dc4ea0.trailingMargin>",
"<NSLayoutConstraint:0x7fd8a3dcbf70 UIView:0x7fd8a3dcb8b0.leading == UIView:0x7fd8a3dc4ea0.leadingMargin>",
"<NSLayoutConstraint:0x7fd8a3dccf80 H:[UIView:0x7fd8a3dcb8b0(368)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fd8a3dccf80 H:[UIView:0x7fd8a3dcb8b0(368)]>
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.
2015-07-19 20:39:28.644 Daily[42447:417537] 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:0x7fd8a3e309e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7fd8a3dc4ea0(375)]>",
"<NSLayoutConstraint:0x7fd8a3dcc3f0 UIView:0x7fd8a3f416c0.leading == UIView:0x7fd8a3dc4ea0.leadingMargin>",
"<NSLayoutConstraint:0x7fd8a3dcc4e0 UIView:0x7fd8a3dc4ea0.centerX == UIView:0x7fd8a3f416c0.centerX>",
"<NSLayoutConstraint:0x7fd8a3dcc620 H:[UIView:0x7fd8a3f416c0(368)]>"
)
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.
You are adding wrong constraints to the views. If you adding centerX constraint then their is no need to add leading space constraint, it will conflict the constraint. Add the constraint as centerX, height, width, & give Y position as you want.
Your approach is appreciable. But, mostly I'd like to develop an app by disabling Auto-layout and classes. You need to set resize margins in the interface builder. If you're not clear with my solution, Please let me know, I'll explain it clearly :) :)

Unable to simultaneously satisfy constraints on opening camera

I have a app which use a webview to show some HTML forms. In HTML forms there is added functionality to choose image from device. All functionality is from HTML form for capturing image. When i click on browse button of form from webview camera opens and everything is working fine but i get below log in xcode.
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
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:0x16fa21f0 UIView:0x180afaa0.height == 0.454545*CAMModeDial:0x16f06760.height - 4.09091>",
"<NSLayoutConstraint:0x18065020 CAMShutterButton:0x180bfbc0.centerY == CAMBottomBar:0x16f06100.centerY>",
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>",
"<NSLayoutConstraint:0x18065ba0 CAMModeDial:0x16f06760.bottom == UIButton:0x180b5870'Cancel'.top>",
"<NSLayoutConstraint:0x180645f0 V:[UIButton:0x180b5870'Cancel']-(31)-| (Names: '|':CAMBottomBar:0x16f06100 )>",
"<NSLayoutConstraint:0x180b6870 'UIView-Encapsulated-Layout-Height' V:[PLImagePickerCameraView:0x170f2600(0)]>",
"<NSLayoutConstraint:0x180b8780 CAMBottomBar:0x16f06100.height == PLImagePickerCameraView:0x170f2600.height>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x16fa21f0 UIView:0x180afaa0.height == 0.454545*CAMModeDial:0x16f06760.height - 4.09091>
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.
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:0x18065020 CAMShutterButton:0x180bfbc0.centerY == CAMBottomBar:0x16f06100.centerY>",
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>",
"<NSLayoutConstraint:0x18065ba0 CAMModeDial:0x16f06760.bottom == UIButton:0x180b5870'Cancel'.top>",
"<NSLayoutConstraint:0x180645f0 V:[UIButton:0x180b5870'Cancel']-(31)-| (Names: '|':CAMBottomBar:0x16f06100 )>",
"<NSLayoutConstraint:0x180b6870 'UIView-Encapsulated-Layout-Height' V:[PLImagePickerCameraView:0x170f2600(0)]>",
"<NSLayoutConstraint:0x180b8780 CAMBottomBar:0x16f06100.height == PLImagePickerCameraView:0x170f2600.height>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>
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.
I am not able to solve it can somebody help me understand these errors and and suggest how to go about solving them?
Edit :- On searching net about CAMShutterButton,CAMModeDial,CAMBottomBar,PLImagePickerCameraView i found CAMShutterButton.h,CAMModeDial.h,CAMBottomBar.h are class files in CameraKit.framework and PLImagePickerCameraView.h is a class file in PhotoLibrary.framework. Which are part of iOS 8 private framework but i am not using any one of them in my application.
Change the priority of the constraint
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>" from Required(1000) to High(750)

What is "UIView-Encapsulated-Layout-*" constraints? How to get rid of them?

Layout error appeared while trying to get the landscape orientation. And layout becomes broken.
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:0x78fc49c0 H:[UILayoutContainerView:0x78e536e0(320)]>",
"<NSLayoutConstraint:0x799cf0e0 'UIView-Encapsulated-Layout-Width' H:[UILayoutContainerView:0x78e536e0(568)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x799cf0e0 'UIView-Encapsulated-Layout-Width' H:[UILayoutContainerView:0x78e536e0(568)]>
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 there is the similar error for vertical constraints.
I did not create those constraints. There are no UITabBar objects. I do not know which other objects create such constraints.

Autolayout shows warning message

i have some Problems with autolayout. Everything gets shown correct and everything works fine but i get some Warning Message in the Command Line:
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:0xb6a60f0 H:[UIImageView:0xb645e40(75)]>",
"<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>",
"<NSLayoutConstraint:0xb6aaea0 H:|-(10)-[UIImageView:0xb645e40] (Names: '|':UITableViewCellContentView:0xb6c1590 )>",
"<NSLayoutConstraint:0xb6c85c0 H:[UIView:0xb6c7350]-(7)-| (Names: '|':UITableViewCellContentView:0xb6c1590 )>",
"<NSLayoutConstraint:0xb6d2270 H:[UIImageView:0xb645e40]-(8)-[UIView:0xb6c7350]>",
"<NSAutoresizingMaskLayoutConstraint:0xb6abd20 h=--& v=--& H:[UITableViewCellContentView:0xb6c1590(300)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView
listed in <UIKit/UIView.h> may also be helpful.
This is how my nib File looks:
As you can see its a TableViewCell and i´m using a View (Sample Text) with a TextView(for iOS7) and a AttributedTextView (for iOS6)!
Whats the Problem?
The problem is that you have conflicting constraints... Auto Layouts can be a pain in the .... sometimes.
When this happens to me, i usually clear all the constraints, and start all over by choosing clear all constraints.
You can also choose to "Add missing constraints" after that, and hope that XCode will automatically know what you want to do.. actually it's a 50-50 chance that XCode will get it right.
From your screen shot, it looks like you have too many constraints, so another option will be to try to remove then one by one, and to catch those "conflicting" constraints.
Set for each view translatesAutoresizingMaskIntoConstraints = NO; That is what he is trying to tell you. During runtime you have your contraints and the generic ones. Guess we will see this property switching to NO as default in a upcomming iOS version.

Resources