Initializing LanguageModelSession crashes app on macOS

Whenever I try to initialize a LanguageModelSession (let session = LanguageModelSession()), my app crashes with EXC_BAD_ACCESS.

SystemLanguageModel.default.availability returns available.

I tried running the two sample projects I found that use Foundation Models, FoundationModelsTripPlanner and SwiftTranscriptionSampleApp, and they both also crash—immediately on launch.

I commented out the Foundation Models logic from the SwiftTranscriptionSampleApp and ran it again, and it no longer crashed.

I'm on macOS 26 Beta 4 on an M1 Pro device. I'm based in Austria (EU), if that matters.

Answered by DTS Engineer in 852623022

I can't reproduce the crash by running your code snippet @itsramensam provided with Xcode 26 Beta 5 + iOS 26 Beta 5.

I tried building the Apple sample with Xcode 26 Beta 5 as well. I got several errors because several symbols had been changed on Beta 5. I went ahead to change the code to make it build. After that, the sample was up and running for me on my macOS / iOS 26 Beta 5 device.

I am wondering if you tested with macOS / iOS 26 Beta 5. Because of the symbol changes, building with Xcode 26 Beta 5 and running on macOS / iOS 26 Beta 4 / 3 may trigger the crash.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I can confirm that this is also happening on iOS when building with Xcode 26.0 beta 5.

The sample code below crashes at let session = LanguageModelSession() with EXC_BAD_ACCESS:

struct ContentView: View {
    var body: some View {
        VStack {}
        .padding()
        .onAppear {
            let session = LanguageModelSession()
        }
    }
}

Also facing this issue when trying to initialize LanguageModelSession in our project when using Xcode 26 Beta 5. I had no issues using Beta 3 version.

When running the FoundationModels sample projects and a basic SwiftUI project, I am also crashing at launch with the following error.

I am on macOS Sequoia 15.5 running Xcode 26 Beta 5 on and iPhone 16 - iOS 26 device. Thank you!

I can't reproduce the crash by running your code snippet @itsramensam provided with Xcode 26 Beta 5 + iOS 26 Beta 5.

I tried building the Apple sample with Xcode 26 Beta 5 as well. I got several errors because several symbols had been changed on Beta 5. I went ahead to change the code to make it build. After that, the sample was up and running for me on my macOS / iOS 26 Beta 5 device.

I am wondering if you tested with macOS / iOS 26 Beta 5. Because of the symbol changes, building with Xcode 26 Beta 5 and running on macOS / iOS 26 Beta 4 / 3 may trigger the crash.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Accepted Answer

@DTS Engineer Thank you for the hints. I was building with Xcode 26 Beta 3 and running on macOS 26 Beta 5 (not 4 as stated in my original message).

I updated to Xcode 26 Beta 5 and it no longer crashes!

Thank you @DTS Engineer!

This was exactly what I had, I was building with Xcode Beta 5 and running on previous iOS 26 versions.

Because of the symbol changes, building with Xcode 26 Beta 5 and running on macOS / iOS 26 Beta 4 / 3 may trigger the crash.

I was able to run properly after upgrading my iOS device to Beta 5 and no more crashes! It seems you'll need to be on both Xcode 26 Beta 5 + iOS 26 Beta 5.

And just FYI: the Apple sample was update for Beta 5.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

For me this crashes:

let session = LanguageModelSession()

but this does not:

let session = LanguageModelSession(instructions: "Some Instructions")

Devices: MacBook Pro in Sequoia 15.6, Xcode 26 Beta 4, iPad Pro iOS 26 Beta 6

Initializing LanguageModelSession crashes app on macOS
 
 
Q