Xcode 26 Beta 5 HealthKit DLYD Symbol Crash

I'm having a problem with Xcode 26 where a symbol bug is causing my app to crash at launch if they are running iOS 17.X

This has to do with a HealthKit API that was introduced in iOS 18.1 HKQuantityType(.appleSleepingBreathingDisturbances), I use availability clauses to ensure I only support it in that version. This all worked fine with Xcode 16.4 but breaks in Xcode 26.

This means ALL my users running iOS 17 will get at launch crashes if this isn't resolved in the Xcode GM seed.

I'll post the code here in case I'm doing anything wrong. This, the HealthKit capability, the "HealthKit Privacy - Health Share Usage Description" and "Privacy - Health Update Usage Description", and device/simulator on iOS 17.X are all you need to reproduce the issue.

I've made a feedback too as I'm 95% sure it's a bug: FB19727966

import SwiftUI
import HealthKit

struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")
        }
        .padding()
        .task {
            print(await requestPermission())
        }
    }
}

#Preview {
    ContentView()
}

func requestPermission() async -> Bool {
    if #available(iOS 18.0, *) {
        let healthTypes = [HKQuantityType(.appleSleepingBreathingDisturbances)]
        var readTypes = healthTypes.map({$0})
        let write: Set<HKSampleType> = []
        let res: ()? = try? await HKHealthStore().requestAuthorization(toShare: write, read: Set(readTypes))
        guard res != nil else {
            print("requestPermission returned nil")
            return false
        }
        return true
    }
    else { return false}
}
Answered by simonfromhelix in 854537022

Fixed in Xcode 26 beta 6!

Accepted Answer

Fixed in Xcode 26 beta 6!

Xcode 26 Beta 5 HealthKit DLYD Symbol Crash
 
 
Q