首页 > 解决方案 > 在启用库演化的情况下构建 iOS 框架时编译错误

问题描述

我使用 swift 5.3 构建了一些包,并启用了库进化。然后我尝试在 swift 5.5 中使用这些包,但出现错误:

Failed to build module 'OrderedCollections'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)', 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.

我验证了这个框架是在启用库进化的情况下构建的。我可以在 swift 界面中看到这一点: // swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name OrderedCollections

我可以用 swift 5.5 重建这些包并且错误消失了,但是由于我们的公司构建系统,这不是我们可以做的。这些包不应该被 swift 5.5 和库进化所消耗吗?

谢谢

标签: iosswiftxcode

解决方案


推荐阅读