xcode 无法在 Swift X.0.2 中导入使用 swift X.1 编译的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43238856/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Module compiled with swift X.1 cannot be imported in Swift X.0.2
提问by etayluz
Swift 3.1 came out and I'm receiving this error message in my project:
Swift 3.1 出来了,我在我的项目中收到此错误消息:
Module compiled with swift 3.1 cannot be imported in Swift 3.0.2
无法在 Swift 3.0.2 中导入使用 swift 3.1 编译的模块
So how do I tell Xcode to start updating my project and migrate it to Swift 3.1?
那么我如何告诉 Xcode 开始更新我的项目并将其迁移到 Swift 3.1?
回答by Mozahler
It is likely that you are including 3rd party frameworks/libraries. Those are what need to be updated/recompiled. If you are using Carthage or Pods you should just rebuild those libraries and make them available to your app. The problem isn't your code. When you compile it, it will compile to 3.1
您很可能包含了 3rd 方框架/库。这些是需要更新/重新编译的内容。如果您使用 Carthage 或 Pods,您应该重建这些库并使它们可用于您的应用程序。问题不在于您的代码。当你编译它时,它会编译为 3.1
回答by VitDuck
回答by iPhoneDeveloper
These steps helped me.
这些步骤帮助了我。
These things happens sometimes when your Xcode doesn't support certain version of your third party dependencies. Try to use proper version of your third party dependencies compatible with Xcode version.
当您的 Xcode 不支持特定版本的第三方依赖项时,有时会发生这些事情。尝试使用与 Xcode 版本兼容的第三方依赖项的正确版本。
- Clear your Derived data in Xcode. Xcode -> File -> Workspace settings -> Click on the grey arrow mark beside Derived data.
- Check carthage version by running
carthage version
. It should be above 0.20.0. Runcarthage update --platform iOS --no-use-binaries
in your terminal. Gets rid of compatibility issues. - Clean your project. Command + Shift + K. Then build and run.
- 清除 Xcode 中的派生数据。Xcode -> File -> Workspace settings -> 单击 Derived data 旁边的灰色箭头标记。
- 通过运行检查迦太基版本
carthage version
。它应该在 0.20.0 以上。carthage update --platform iOS --no-use-binaries
在您的终端中运行。摆脱兼容性问题。 - 清理你的项目。Command + Shift + K。然后构建并运行。