badoo/Chatto

NSLayoutConstraint error when using expandable input and switching input

Open

#577 opened on May 22, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Swift (4,166 stars) (561 forks)batch import
bughelp wanted

Description

Reproducible with the demo app, using the "Chat with expandable input" example.

Steps to reproduce:

  1. Press the keyboard chat input icon.
  2. Press the camera chat input icon.

The console will show the following error:

2019-05-22 10:55:34.230615-0400 ChattoApp[3658:2922342] [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. 
(
    "<_UILayoutSupportConstraint:0x2814a9f90 _UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide'.height == 64   (active)>",
    "<_UILayoutSupportConstraint:0x2814a9810 V:|-(0)-[_UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide']   (active, names: '|':Chatto.BaseChatViewControllerView:0x101c64670 )>",
    "<NSLayoutConstraint:0x2814a94a0 V:[UIView:0x101ca67e0]-(667)-|   (active, names: '|':Chatto.BaseChatViewControllerView:0x101c64670 )>",
    "<NSLayoutConstraint:0x2814df110 UIView:0x101d53d00.height == 44   (active)>",
    "<NSLayoutConstraint:0x2814c06e0 V:|-(0)-[UIView:0x101d53d00]   (active, names: '|':ChattoAdditions.ChatInputBar:0x101c3ea50 )>",
    "<NSLayoutConstraint:0x2814c27b0 V:[UIView:0x101d53d00]-(0)-|   (active, names: '|':ChattoAdditions.ChatInputBar:0x101c3ea50 )>",
    "<NSLayoutConstraint:0x2814c1900 UIView:0x101ca67e0.top == ChattoAdditions.ChatInputBar:0x101c3ea50.top   (active)>",
    "<NSLayoutConstraint:0x2814c20d0 V:[ChattoAdditions.ChatInputBar:0x101c3ea50]-(0)-|   (active, names: '|':UIView:0x101ca67e0 )>",
    "<NSLayoutConstraint:0x2814aa580 V:[_UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide']-(>=0)-[UIView:0x101ca67e0]   (active)>",
    "<NSLayoutConstraint:0x2814f4230 'UIView-Encapsulated-Layout-Height' Chatto.BaseChatViewControllerView:0x101c64670.height == 667   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x2814df110 UIView:0x101d53d00.height == 44   (active)>

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-05-22 10:55:34.243398-0400 ChattoApp[3658:2922342] [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. 
(
    "<_UILayoutSupportConstraint:0x2814a9f90 _UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide'.height == 64   (active)>",
    "<_UILayoutSupportConstraint:0x2814a9810 V:|-(0)-[_UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide']   (active, names: '|':Chatto.BaseChatViewControllerView:0x101c64670 )>",
    "<NSLayoutConstraint:0x2814aa580 V:[_UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide']-(>=0)-[UIView:0x101ca67e0]   (active)>",
    "<NSLayoutConstraint:0x2814a94a0 V:[UIView:0x101ca67e0]-(667)-|   (active, names: '|':Chatto.BaseChatViewControllerView:0x101c64670 )>",
    "<NSLayoutConstraint:0x2814f4230 'UIView-Encapsulated-Layout-Height' Chatto.BaseChatViewControllerView:0x101c64670.height == 667   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x2814aa580 V:[_UILayoutSpacer:0x2808e9e00'UIVC-topLayoutGuide']-(>=0)-[UIView:0x101ca67e0]   (active)>

Contributor guide