我最近开始了我的第一个 swift 体验,但我遇到了一个错误
'Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler'
我认为只要在build设置中选择我的 swift 语言版本就可以缓和这个错误。但它不起作用。
经过几次搜索,我发现有两个选项
- 降级 Xcode
- 使用 swift 5.0 更新模块或重建模块
它们是我唯一的选择吗?我不知道为什么更改 swift 语言版本没有任何作用。
最佳答案
Xcode 10.2 自带的 swift 5 编译器可以在 swift 4 模式下编译。然而,它仍然是 swift 5 编译器,而不是 Xcode 10.1 中的 swift 4 编译器。 swift 5 编译器无法导入使用 swift 4 编译器构建的模块。
因此,您列出的两个选项是您仅有的选项。
关于ios - 我可以将 swift 版本降级到中度错误 'Module compiled with Swift x.x cannot be imported by the Swift x.x compiler' 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55822086/