SwiftUI: NavigationSplitView + Toolbar + Button = Constraint Warning

As the title says, when I try to add a Toolbar with a Button to my NavigationSplitView I get a warning about satisfying constraints.

Here is a minimal reproducible example:

import SwiftUI

@main
struct ViewTestingApp: App {
    var body: some Scene {
        WindowGroup {
            NavigationSplitView {
                Text("Sidebar")
                    .toolbar {
                        ToolbarItem(placement: .topBarTrailing) {
                            Button {
                                debugPrint("Hello World!")
                            } label: {
                                Label("", systemImage: "flame")
                            }
                        }
                    }
            } content: {
                Text("Content")
            } detail: {
                Text("Detail")
            }
        }
    }
}

This is the specific warning I get:

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:0x600002164960 h=--& v=--& _TtCC5UIKit19NavigationButtonBar15ItemWrapperView:0x100f80fa0.width == 0   (active)>",
    "<NSLayoutConstraint:0x600002160370 _TtCC5UIKit19NavigationButtonBar15ItemWrapperView:0x100f80fa0.leading == _UIButtonBarButton:0x100f7d360.leading   (active)>",
    "<NSLayoutConstraint:0x6000021603c0 H:[_UIButtonBarButton:0x100f7d360]-(0)-|   (active, names: '|':_TtCC5UIKit19NavigationButtonBar15ItemWrapperView:0x100f80fa0 )>",
    "<NSLayoutConstraint:0x600002160050 'IB_Leading_Leading' H:|-(2)-[_UIModernBarButton:0x100f7e6c0]   (active, names: '|':_UIButtonBarButton:0x100f7d360 )>",
    "<NSLayoutConstraint:0x6000021600a0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x100f7e6c0]-(2)-|   (active, names: '|':_UIButtonBarButton:0x100f7d360 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000021600a0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x100f7e6c0]-(2)-|   (active, names: '|':_UIButtonBarButton:0x100f7d360 )>

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.

The project settings are all at their defaults, but in case anyone wants to try it with the whole project: https://github.com/OddMagnet/ViewTesting

Thanks for the post and thank you for bringing this issue to our attention. Indeed, this is a known problem where SwiftUI control will need to resize a window with a NavigationSplitView generates Invalid view geometry warnings in Xcode. The issue is currently being investigated.

If you would like to be notified when the fix is implemented and Xcode ceases to issue these warnings, we recommend filing a bug report. The warning looks something like this:

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..

In the meantime, please be advised that the engineering team is actively addressing the warning issue.

If you want to file a bug please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Albert Pascual
  Worldwide Developer Relations.

Thanks for the information. Here's the FB number: FB21309174

Thank you for your response and the FB number. I have reviewed the bug you posted, but the code provided lacks a focused sample. While this may be acceptable as it is easy to reproduce within the team, I would always recommend providing a focused sample to ensure quick reproduction across teams.

Please give the engineering sometime to review it and expect an answer from them in the Feedback Assistant app.

For more details on when you'll see updates to your report, please see What to expect after submission.

Albert Pascual
  Worldwide Developer Relations.

SwiftUI: NavigationSplitView &#43; Toolbar &#43; Button = Constraint Warning
 
 
Q