1

I'm getting this error [LayoutConstraints] Unable to simultaneously satisfy constraints. with a bunch of logs below it (shown below). There is this post attempting to solve it. But I'm not sure what a constraint is and I can't find any documentation on it's definition/diagrams.

Is there an explanation anywhere on what constraints are? This documentation on NSLayoutConstraint is pretty dense and cryptic to me e.g. "constraint based layout system." An explanation would be super beneficial to help me debug this.

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:0x6000021777a0 UIView:0x7fe80893f840.trailing == _UIBackButtonMaskView:0x7fe808939a90.trailing   (active)>",
    "<NSLayoutConstraint:0x600002168780 'Mask_Trailing_Trailing' _UIBackButtonMaskView:0x7fe808939a90.trailing == BackButton.trailing   (active, names: BackButton:0x7fe808a18380 )>",
    "<NSLayoutConstraint:0x6000021688c0 'MaskEV_Leading_BIB_Trailing' H:[_UIModernBarButton:0x7fe80891d0c0]-(0)-[UIView:0x7fe80893f840]   (active)>",
    "<NSLayoutConstraint:0x600002168fa0 'UINav_static_button_horiz_position' _UIModernBarButton:0x7fe80891d0c0.leading == UILayoutGuide:0x600003b61880'UIViewLayoutMarginsGuide'.leading   (active)>",
    "<NSLayoutConstraint:0x600002169040 'UINavItemContentGuide-leading' H:[BackButton]-(6)-[UILayoutGuide:0x600003b61260'UINavigationBarItemContentLayoutGuide']   (active, names: BackButton:0x7fe808a18380 )>",
    "<NSLayoutConstraint:0x60000217f7a0 'UINavItemContentGuide-trailing' UILayoutGuide:0x600003b61260'UINavigationBarItemContentLayoutGuide'.trailing == _UINavigationBarContentView:0x7fe808b2a9a0.trailing   (active)>",
    "<NSLayoutConstraint:0x60000216f1b0 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fe808b2a9a0.width == 0   (active)>",
    "<NSLayoutConstraint:0x60000217fb60 'UIView-leftMargin-guide-constraint' H:|-(8)-[UILayoutGuide:0x600003b61880'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UINavigationBarContentView:0x7fe808b2a9a0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000021777a0 UIView:0x7fe80893f840.trailing == _UIBackButtonMaskView:0x7fe808939a90.trailing   (active)>
Paul
  • 1,101
  • 1
  • 11
  • 20
  • 2
    It's a bug on Apple's side. Constraints are how you lay out views in UIKit. SwiftUI's `NavigationView` has some connection to `UINavigationBar`, which has some constraint bug. You can probably ignore it. – aheze Nov 30 '21 at 01:41
  • Ok, is there a way to silence these? – Paul Nov 30 '21 at 01:56
  • 2
    @elyakshaver If caused by `NavigationView`, add a `.navigationViewStyle(.stack)` to the end – George Nov 30 '21 at 02:00
  • @George awesome, I'll give this a try. Thank you! – Paul Nov 30 '21 at 16:30

0 Answers0