Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout constraint problem, Xcode 11 and iOS 13 #1592

Closed
kevint727 opened this issue Sep 3, 2019 · 8 comments
Closed

Layout constraint problem, Xcode 11 and iOS 13 #1592

kevint727 opened this issue Sep 3, 2019 · 8 comments

Comments

@kevint727
Copy link

kevint727 commented Sep 3, 2019

Using the latest Xcode 11 beta and its' accompanying simulators (and a physical device) running iOS 13, when trying to type in a UITextField, I get the following layout constraint error. This happens for any TextField on any of my views. I am using the latest version of IQKeyboardManager (6.4.1). I have never seen this before and I have been using the wonderful IQKeyboardManager for quite some time. I realize this is on beta software but just want to make sure this will not be an issue going forward as I've had iPhones (especially older ones) freeze up before in the wild because of layout constraint problems.
[LayoutConstraints] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000004760d0 h=--& v=--& _UIToolbarContentView:0x7f8118925880.width == 0 (active)>",
"<NSLayoutConstraint:0x6000004ec550 H:|-(0)-[_UIButtonBarStackView:0x7f8118925d50] (active, names: '|':_UIToolbarContentView:0x7f8118925880 )>",
"<NSLayoutConstraint:0x6000004eddb0 _UIButtonBarStackView:0x7f8118925d50.trailing == _UIToolbarContentView:0x7f8118925880.trailing (active)>",
"<NSLayoutConstraint:0x60000045e170 'TB_Leading_Leading' H:|-(8)-[_UIModernBarButton:0x7f811875eef0'Done'] (active, names: '|':_UIButtonBarButton:0x7f811875eb90 )>",
"<NSLayoutConstraint:0x60000045e1c0 'TB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875eef0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7f811875eb90 )>",
"<NSLayoutConstraint:0x6000004754a0 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f811875d850.leading (active)>",
"<NSLayoutConstraint:0x600000475540 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f811875eb90.trailing (active)>",
"<NSLayoutConstraint:0x6000004754f0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875d850]-(0)-[UIView:0x7f811875dfe0] (active)>",
"<NSLayoutConstraint:0x600000475590 'UISV-spacing' H:[UIView:0x7f811875dfe0]-(0)-[_UIButtonBarButton:0x7f811875e140] (active)>",
"<NSLayoutConstraint:0x6000004755e0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875e140]-(0)-[UIView:0x7f811875e8d0] (active)>",
"<NSLayoutConstraint:0x600000475630 'UISV-spacing' H:[UIView:0x7f811875e8d0]-(0)-[UIView:0x7f811892cbe0] (active)>",
"<NSLayoutConstraint:0x600000475680 'UISV-spacing' H:[UIView:0x7f811892cbe0]-(0)-[UIView:0x7f811875ea30] (active)>",
"<NSLayoutConstraint:0x6000004756d0 'UISV-spacing' H:[UIView:0x7f811875ea30]-(0)-[_UIButtonBarButton:0x7f811875eb90] (active)>",
"<NSLayoutConstraint:0x6000004d40a0 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>",
"<NSLayoutConstraint:0x6000004c87d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000045e1c0 'TB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875eef0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7f811875eb90 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-09-04 15:23:02.298774-0700 DevSwitcher[99909:4970416] [LayoutConstraints] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000004760d0 h=--& v=--& _UIToolbarContentView:0x7f8118925880.width == 0 (active)>",
"<NSLayoutConstraint:0x6000004ec550 H:|-(0)-[_UIButtonBarStackView:0x7f8118925d50] (active, names: '|':_UIToolbarContentView:0x7f8118925880 )>",
"<NSLayoutConstraint:0x6000004eddb0 _UIButtonBarStackView:0x7f8118925d50.trailing == _UIToolbarContentView:0x7f8118925880.trailing (active)>",
"<NSLayoutConstraint:0x60000045d270 'IB_Leading_Leading' H:|-(0)-[_UIModernBarButton:0x7f811875da20] (active, names: '|':_UIButtonBarButton:0x7f811875d850 )>",
"<NSLayoutConstraint:0x60000045d2c0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875da20]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7f811875d850 )>",
"<NSLayoutConstraint:0x6000004754a0 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f811875d850.leading (active)>",
"<NSLayoutConstraint:0x600000475540 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f811875eb90.trailing (active)>",
"<NSLayoutConstraint:0x6000004754f0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875d850]-(0)-[UIView:0x7f811875dfe0] (active)>",
"<NSLayoutConstraint:0x600000475590 'UISV-spacing' H:[UIView:0x7f811875dfe0]-(0)-[_UIButtonBarButton:0x7f811875e140] (active)>",
"<NSLayoutConstraint:0x6000004755e0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875e140]-(0)-[UIView:0x7f811875e8d0] (active)>",
"<NSLayoutConstraint:0x600000475630 'UISV-spacing' H:[UIView:0x7f811875e8d0]-(0)-[UIView:0x7f811892cbe0] (active)>",
"<NSLayoutConstraint:0x600000475680 'UISV-spacing' H:[UIView:0x7f811892cbe0]-(0)-[UIView:0x7f811875ea30] (active)>",
"<NSLayoutConstraint:0x6000004756d0 'UISV-spacing' H:[UIView:0x7f811875ea30]-(0)-[_UIButtonBarButton:0x7f811875eb90] (active)>",
"<NSLayoutConstraint:0x6000004d40a0 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>",
"<NSLayoutConstraint:0x6000004c87d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000045d2c0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875da20]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7f811875d850 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-09-04 15:23:02.310129-0700 DevSwitcher[99909:4970416] [LayoutConstraints] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000004760d0 h=--& v=--& _UIToolbarContentView:0x7f8118925880.width == 0 (active)>",
"<NSLayoutConstraint:0x6000004ec550 H:|-(0)-[_UIButtonBarStackView:0x7f8118925d50] (active, names: '|':_UIToolbarContentView:0x7f8118925880 )>",
"<NSLayoutConstraint:0x6000004eddb0 _UIButtonBarStackView:0x7f8118925d50.trailing == _UIToolbarContentView:0x7f8118925880.trailing (active)>",
"<NSLayoutConstraint:0x60000045d7c0 'IB_Leading_Leading' H:|-(>=5)-[_UIModernBarButton:0x7f811875e310] (active, names: '|':_UIButtonBarButton:0x7f811875e140 )>",
"<NSLayoutConstraint:0x60000045d810 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875e310]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7f811875e140 )>",
"<NSLayoutConstraint:0x6000004754a0 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f811875d850.leading (active)>",
"<NSLayoutConstraint:0x600000475540 'UISV-canvas-connection' UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f811875eb90.trailing (active)>",
"<NSLayoutConstraint:0x6000004754f0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875d850]-(0)-[UIView:0x7f811875dfe0] (active)>",
"<NSLayoutConstraint:0x600000475590 'UISV-spacing' H:[UIView:0x7f811875dfe0]-(0)-[_UIButtonBarButton:0x7f811875e140] (active)>",
"<NSLayoutConstraint:0x6000004755e0 'UISV-spacing' H:[_UIButtonBarButton:0x7f811875e140]-(0)-[UIView:0x7f811875e8d0] (active)>",
"<NSLayoutConstraint:0x600000475630 'UISV-spacing' H:[UIView:0x7f811875e8d0]-(0)-[UIView:0x7f811892cbe0] (active)>",
"<NSLayoutConstraint:0x600000475680 'UISV-spacing' H:[UIView:0x7f811892cbe0]-(0)-[UIView:0x7f811875ea30] (active)>",
"<NSLayoutConstraint:0x6000004756d0 'UISV-spacing' H:[UIView:0x7f811875ea30]-(0)-[_UIButtonBarButton:0x7f811875eb90] (active)>",
"<NSLayoutConstraint:0x6000004d40a0 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>",
"<NSLayoutConstraint:0x6000004c87d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x600001eca5a0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7f8118925d50 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000045d810 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x7f811875e310]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7f811875e140 )>

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

@kevint727 kevint727 changed the title Layout constraint problem causing simulator to freeze - Xcode 11 beta Layout constraint problem causing simulator to freeze - Xcode 11 beta iOS 13 Sep 4, 2019
@kevint727 kevint727 changed the title Layout constraint problem causing simulator to freeze - Xcode 11 beta iOS 13 Layout constraint problem, Only in Xcode 11 beta iOS 13 Sep 6, 2019
@kevint727 kevint727 changed the title Layout constraint problem, Only in Xcode 11 beta iOS 13 Layout constraint problem, Only in Xcode 11 beta with iOS 13 Sep 6, 2019
@sameh0
Copy link

sameh0 commented Sep 6, 2019

Same HERE

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600003fca800 'TB_Trailing_Trailing' H:[_UIModernBarButton:0x7fd2bb54bfe0'Done']-(0)-|   (active, names: '|':_UIButtonBarButton:0x7fd2bb54abb0 )>

@kevint727
Copy link
Author

This is still happening in the Xcode 11 GM seed and with using 6.4.2.

@dhomes
Copy link

dhomes commented Sep 12, 2019

same with xcode11 gm & 6.4.2

@kevint727 kevint727 changed the title Layout constraint problem, Only in Xcode 11 beta with iOS 13 Layout constraint problem, Xcode 11 and iOS 13 Sep 15, 2019
@mobileappdeveloper2019
Copy link

mobileappdeveloper2019 commented Sep 16, 2019

No i have put Mapbox with IQmanager and when ever Mapbox opens the y axis offset of IQkeyboard manger changes and toolbar will not able to show. if any one have any soultion then it will be more appriciate

@tosbaha
Copy link

tosbaha commented Sep 17, 2019

You can fix this issue by adding a non empty frame for UIToolbar in library code. I am not familiar with how this library initializes the UIToolbar. Check the source code make the changes according to below example.

So instead of doing

let toolbard = UIToolbar()

Do it like below

let toolbard =  UIToolbar(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 35))

@mobileappdeveloper2019
Copy link

Dear @tosbaha

Thanks for reply, actually when ever Mapbox opens then keyboradFrameOffset changes from 0 to -260 and it will create problem to IQKeyboardManager toolbar offset. no need to change toolbar frame, I need to know what can I change in Mapbox so that it will fix in IQKeyboard.

[
Screenshot 2019-09-17 at 5 55 54 PM
Screenshot 2019-09-17 at 5 56 03 PM

](url)

@tosbaha
Copy link

tosbaha commented Sep 17, 2019

@mobileappdeveloper2019 I am sorry I don't use this library at all. I just commented because I had similar issue on iOS 13. I am not sure but you may try to change

let newToolbar = IQToolbar()

line with

let newToolbar = IQToolbar(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 35))

Good luck.

@fritzgt
Copy link

fritzgt commented Mar 21, 2020

I had the same issue and I was able to fix it by following this.
Section:
Working with TopLayoutGuide and BottomLayoutGuide (Below v6.0.0)
Link:
https://github.com/hackiftekhar/IQKeyboardManager/wiki/Manual-Management#working-with-toplayoutguide-and-bottomlayoutguide-below-v600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants