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

**URL:** <https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972>\
**Category:** Using Swift\
**Tags:** concurrency, toolchain, xcode, swiftui, swift6\
**Created:** [September 26, 2024, 8:34pm UTC](https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972 "2024-09-26T20:34:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulhdk](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/paulhdk/32/37481_2.png) [@paulhdk](https://forums.swift.org/u/paulhdk)\
**Post date:** [September 26, 2024, 8:34pm UTC](https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972/1 "2024-09-26T20:34:00Z")

</div>

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](https://forums.swift.org/t/why-does-sending-a-sendable-value-risk-causing-data-races/73074) and which was fixed in [this commit](https://github.com/swiftlang/swift/commit/f0fff2e5a02d8f56fc272ed0562a888d10f17f9b) as part of Swift 6.0.1.

Am I missing something? Do you have any pointers?

Many thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![dima\_kozhinov](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@dima\_kozhinov](https://forums.swift.org/u/dima_kozhinov)\
**Post date:** [September 26, 2024, 9:01pm UTC](https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972/2 "2024-09-26T21:01:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dima\_kozhinov](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@dima\_kozhinov](https://forums.swift.org/u/dima_kozhinov)\
**Post date:** [September 26, 2024, 9:23pm UTC](https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972/3 "2024-09-26T21:23:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulhdk](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/paulhdk/32/37481_2.png) [@paulhdk](https://forums.swift.org/u/paulhdk)\
**Post date:** [September 27, 2024, 4:49pm UTC](https://forums.swift.org/t/unable-to-use-swiftui-with-latest-swift-6-0-1-compiler-due-to-toolchain-sdk-mismatch/74972/4 "2024-09-27T16:49:24Z")

</div>

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