我想使用Xcode 9 beta测试我的应用。现在我回到Xcode 8,我有以下错误:
Module compiled with swift 4.0 cannot be imported in swift 3.1
要解决此错误,我刷新所有迦太基构建并进行一些清理:
build
和checkout
Derived Data
目录但错误仍然存在。
使用的命令是:'carthage update --platform iOS'
由于问题始终存在于同一个框架DeviceKit
,然后我设法将其从Cartfile
中删除。
项目构建然后显示错误,因为找不到DeviceKit
。
然后,我将其重新添加到Cartfile
并运行carthage update DeviceKit --platform iOS --no-use-binaries
这个相关的问题为Cocoapods提供了答案:Module compiled with swift 4.0 cannot be imported in swift 3.1
答案 0 :(得分:4)
通过以下步骤解决:
rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData
carthage update --platform iOS
我在专门的 Carthage '上找到了答案。 GitHub上的页面:https://github.com/Carthage/Carthage/issues/2062