Xcode 13.0 with Swift 5.5 will no longer build my project with an "import CreateML" statement, how to fix?

Viewed 5869

After installing Xcode 13.0, which updates the version of Swift to 5.5, I am getting this error:

Failed to build module 'CreateML'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4 (swiftlang-1205.0.24.14 clang-1205.0.19.54)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)'). Please select a toolchain which matches the SDK.

Installing and selecting toolchains back to 5.4 and even 5.3.3 doesn't help. Here's the error message for 5.4:

Failed to build module 'CreateML' from its module interface; the compiler that produced it, 'Apple Swift version 5.4 (swiftlang-1205.0.24.14 clang-1205.0.19.54)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.4 (swift-5.4-RELEASE)'

Does anyone know how to fix this?

1 Answers

I eventually fixed this after updating to Monterey and changing the build settings to target 12.0 (was 10.13 before).

Related