toolbarMinimizationBehavior(_:for:) crashes on some iOS 27.0.0 devices: "missing weak symbol" despite #available(iOS 27.0, *)

We are seeing a production crash that only affects devices reporting iOS 27.0.0. Devices on 27.0.1 and later, and on iOS 26, are unaffected. The app is built with Xcode 27.0 (the same binary shape appears with the Xcode 27.1 RC toolchain), deployment target iOS 26.0.

The crashing code is a plain availability-gated call:

extension View {
    @ViewBuilder
    func disableNavigationBarMinimization() -> some View {
        if #available(iOS 27.0, *) {
            toolbarMinimizationBehavior(.never, for: .navigationBar)
        } else {
            self
        }
    }
}

Crash report excerpt (addresses and app symbols removed):

crash_info_entry_0: Failed to look up symbolic reference at <addr> - offset <n>
- symbol <nearest stripped symbol> in <app binary>
- pointer at <addr> is likely a reference to a missing weak symbol

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib   __pthread_kill
2  libsystem_c.dylib        abort
3  libswiftCore.dylib       <redacted>
9  libswiftCore.dylib       swift_getTypeByMangledName + 908
10 libswiftCore.dylib       swift_getTypeByMangledNameInContext2 + 248
11 <app>                    __swift_instantiateConcreteTypeFromMangledNameV2
12 <app>                    specialized closure #1 in View.disableNavigationBarMinimization()
13 <app>                    closure #1 in SomeView.body.getter

What we established:

  1. Because the deployment target is 26.0 and the API is @available(iOS 27.0, *), the app weak-imports both the function and its opaque result type descriptor. dyld_info -imports on the binary shows:
_$s7SwiftUI4ViewPAAE27toolbarMinimizationBehavior_3forQrAA07ToolbareF0V_AA0H9PlacementVdtF [weak-import] (from SwiftUI)
_$s7SwiftUI4ViewPAAE27toolbarMinimizationBehavior_3forQrAA07ToolbareF0V_AA0H9PlacementVdtFQOMQ [weak-import] (from SwiftUI)
  1. The call site has to instantiate the opaque return type's metadata before calling the function. That is the frame that aborts. So when dyld binds the descriptor to null, #available(iOS 27.0, *) passes and the process still dies.

  2. The symbol is present and exported on the iOS 27.0 build we can inspect locally (24A437, via Xcode's DeviceSupport symbols), and the same code runs fine on the iOS 27.0 simulator runtime (24A434). We cannot reproduce the crash on any device we own.

  3. The SwiftUI binary in 24A437 exports both toolbarMinimizeBehavior(_:for:) / ToolbarMinimizeBehavior and toolbarMinimizationBehavior(_:for:) / ToolbarMinimizationBehavior. The iOS 27.1 SDK only declares the latter, still annotated @available(iOS 27.0, *). This looks like a rename late in the 27.0 cycle.

Our working theory is that some iOS 27.0.0 builds in the field (earlier 27.0 builds, possibly the ones preinstalled on new devices) predate the rename and only contain toolbarMinimizeBehavior, so the renamed symbol is absent and the weak import resolves to null.

Questions:

  • Is the @available(iOS 27.0, *) annotation on toolbarMinimizationBehavior(_:for:) accurate for every shipped 27.0.0 build? Should it be 27.0.1 or 27.1?
  • Is there a supported way to guard against a missing opaque type descriptor at runtime, short of raising the availability check?

Feedback filed as FB25095054.

toolbarMinimizationBehavior(_:for:) crashes on some iOS 27.0.0 devices: "missing weak symbol" despite #available(iOS 27.0, *)
 
 
Q