SwiftUI bottom bar triggers UIKitToolbar hierarchy fault and constraint errors

[Submitted as FB21958289]

A minimal SwiftUI app logs framework warnings when a bottom bar Menu is used with the system search toolbar item. The most severe issue is logged as a console Fault (full logs below):

Adding 'UIKitToolbar' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.

This appears to be a framework-level SwiftUI/UIKit integration issue, not custom UIKit embedding in app code. The UI may still render, but the warnings indicate an internal hierarchy/layout conflict.

This occurs in simulator and physical device.

REPRO STEPS

  1. Create a new project then replace ContentView with the code below.
  2. Run the app.
  3. The view uses NavigationStack + .searchable + .toolbar with:
    • ToolbarItem(placement: .bottomBar) containing a Menu
    • DefaultToolbarItem(kind: .search, placement: .bottomBar)

EXPECTED RESULT

No view hierarchy or Auto Layout warnings in the console.

ACTUAL RESULT

Console logs warnings such as:

  • "Adding 'UIKitToolbar' as a subview of UIHostingController.view is not supported..."
  • "Ignoring searchBarPlacementBarButtonItem because its vending navigation item does not match the view controller's..."
  • "Unable to simultaneously satisfy constraints..." (ButtonWrapper/UIButtonBarButton width and trailing constraints)

MINIMAL REPRO CODE

import SwiftUI

struct ContentView: View {
    @State private var searchText = ""
    @State private var isSearchPresented = false

    var body: some View {
        NavigationStack {
            List(0..<30, id: \.self) { index in
                Text("Row \(index)")
            }
            .navigationTitle("Toolbar Repro")
            .searchable(text: $searchText, isPresented: $isSearchPresented)
            .toolbar {
                ToolbarItem(placement: .bottomBar) {
                    Menu {
                        Button("Action 1") { }
                        Button("Action 2") { }
                    } label: {
                        Label("Actions", systemImage: "ellipsis.circle")
                    }
                }

                DefaultToolbarItem(kind: .search, placement: .bottomBar)
            }
        }
    }
}

CONSOLE LOG

Adding 'UIKitToolbar' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.
Ignoring searchBarPlacementBarButtonItem because its vending navigation item does not match the view controller's. view controller: <_TtGC7SwiftUI32NavigationStackHostingControllerVS_7AnyView_: 0x106014c00>; vc's navigationItem = <UINavigationItem: 0x105530320> title='Toolbar Repro' style=navigator searchController=0x106131200 SearchBarHidesWhenScrolling-default; vending navigation item <UINavigationItem: 0x106db4270> style=navigator searchController=0x106131200 SearchBarHidesWhenScrolling-explicit
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. 
(
    "<NSLayoutConstraint:0x600002171450 _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x106a31fe0.width == _UIButtonBarButton:0x106dc4010.width   (active)>",
    "<NSLayoutConstraint:0x6000021558b0 'IB_Leading_Leading' H:|-(8)-[_UIModernBarButton:0x106a38010]   (active, names: '|':_UIButtonBarButton:0x106dc4010 )>",
    "<NSLayoutConstraint:0x600002170eb0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x106a38010]-(8)-|   (active, names: '|':_UIButtonBarButton:0x106dc4010 )>",
    "<NSLayoutConstraint:0x60000210aa80 'UIView-Encapsulated-Layout-Width' _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x106a31fe0.width == 0   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600002170eb0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x106a38010]-(8)-|   (active, names: '|':_UIButtonBarButton:0x106dc4010 )>

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.
Failed to send CA Event for app launch measurements for ca_event_type: 0 event_name: com.apple.app_launch_measurement.FirstFramePresentationMetric
Failed to send CA Event for app launch measurements for ca_event_type: 1 event_name: com.apple.app_launch_measurement.ExtendedLaunchMetrics
Answered by DTS Engineer in 885478022

Thank you for reporting this.

We are aware of this issue and are investigating resolutions. Updates will be provided to you in Feedback Assistant.

I encourage you to test new software versions as they are released and update us here if anything changes.

 Travis

Here’s an even simpler repro sample that removes List and .searchable entirely:

struct ContentView: View {
    var body: some View {
        NavigationStack {
            Text("Hello, World!")
                .navigationTitle("Toolbar Repro")
                .toolbar {
                    ToolbarItem(placement: .bottomBar) {
                        Menu {
                            Button("Action 1") { }
                            Button("Action 2") { }
                        } label: {
                            Label("Actions", systemImage: "ellipsis.circle")
                        }
                    }
                }
        }
    }
}
import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            Text("XX")
            .toolbar {
                ToolbarItem(placement: .bottomBar) {
                    Text("YY")
                }
            }
        }
    }
}

Here is an even simpler ContentView that demonstrates the same error.

This occurs for both iOS 26.4 and iPadOS 26.4

The output generated in the Xcode console is:

'UIKitToolbar' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.

Thank you for reporting this.

We are aware of this issue and are investigating resolutions. Updates will be provided to you in Feedback Assistant.

I encourage you to test new software versions as they are released and update us here if anything changes.

 Travis

SwiftUI bottom bar triggers UIKitToolbar hierarchy fault and constraint errors
 
 
Q