I’m facing an issue while compiling a project with a CustomSDK on Xcode 16.0 Beta 6. The following error is displayed during the build process:
Failed to build module 'CustomSDK'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)', while this compiler is 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)'). Please select a toolchain which matches the SDK.
Steps I have taken so far:
- Set the
BUILD_LIBRARY_FOR_DISTRIBUTION
build setting toYES
in the post_install script to ensure forward compatibility. - Cleaned the project and deleted Derived Data.
- Verified that the latest SDK version was compiled using Swift 5 in Xcode 15.2, which should ensure compatibility with future versions.
- Tried re-adding the SDK pod and rebuilt the project.
Despite these steps, the issue persists on Xcode 16 Beta 6. I suspect the problem could be related to a beta version of Xcode and compatibility issues, but I need guidance on how to ensure the SDK works with Xcode 16.
Is this a known issue with Swift versioning in the beta release? Are there any workarounds or specific changes I should apply to make the SDK work with Xcode 16 Beta 6?
Any help or suggestions would be appreciated!
In general, Xcode N should be able to use XCFrameworks generated by Xcode M, where M ≤ N, as long as the framework was built with library evolution enabled [1].
You mentioned “pod”, which suggests you’re using CocoaPods. If you want to investigate this further, I recommend that you focus on Apple tools. That it, build your XCFramework with Xcode 15 and its related tooling, add that directly to an Xcode 16 test client project, and try building that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] This is controlled by the Build Libraries for Distribution build setting, which it seems that you’re setting.