Unable to Use SwiftUI With Latest Swift 6.0.1. Compiler Due to Toolchain / SDK Mismatch

After downloading Swift 6.0.1 and setting in Xcode via Xcode -> Toolchains, I’m getting the following error message when attempting to import SwiftUI:

Failed to build module 'SwiftUI'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.7.24 clang-1600.0.25.1)', while this compiler is 'Apple Swift version 6.0.1 (swift-6.0.1-RELEASE)'). Please select a toolchain which matches the SDK.

The reason I had downloaded it in the first place was because I ran into a similar issue to the one that was discussed in this forum post and which was fixed in this commit as part of Swift 6.0.1.

Am I missing something? Do you have any pointers?

Many thanks,
Paul

1 Like

I wonder how it correlates with declared ABI Stability. Only compiler was changed, nothing else.

Update: Well, probably not "only compiler" was changed. The updated toolchain contains also some libraries, which may have updated/changed APIs.

I believe you have to wait for the next Xcode release to use Swift 6.0.1.
A standalone 6.0.1 compiler should probably work outside of Xcode only, e.g. with SwiftPM projects.

Right. I’ll try again once Xcode 16.1 Beta 3 is out. Thanks for looking into this, @dima_kozhinov!