xcode 模块文件是由旧版本的编译器创建的
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36661635/
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 file was created by an older version of the compiler
提问by vikzilla
Using Carthage to manage my dependencies, everything runs fine in the simulator.
使用 Carthage 管理我的依赖项,在模拟器中一切正常。
However, when building for a device I get the following error:
但是,在为设备构建时,我收到以下错误:
Module File was created by an older version of the compiler; rebuild Alamofire and try again: .../DerivedData/Build/Products/Debug-iPhones...
I have tried what others suggested to similar issues: deleting my derived data, reinstalling Carthage and rebuilding the frameworks. However, the error has been persistent.
我已经尝试了其他人对类似问题的建议:删除我的派生数据,重新安装 Carthage 并重建框架。但是,错误一直存在。
回答by Rahul Katariya
Are you using the right version of xcodebuild? What do you see when you run xcode-select -p? It should be pointed at Xcode 7 if you want to use the frameworks in Xcode 7.
您使用的是正确版本的 xcodebuild 吗?运行 xcode-select -p 时会看到什么?如果你想使用 Xcode 7 中的框架,它应该指向 Xcode 7。
Remove all the derive data rm -rf ~/Library/Developer/Xcode/DerivedData/ && carthage build
删除所有派生数据 rm -rf ~/Library/Developer/Xcode/DerivedData/ && carthage build
Also, When you use carthage update
without --no-use-binariesoption then it downloads the pre built frameworks which may be built using the old version of xcodebuild.
此外,当您在carthage update
没有 --no-use-binaries选项的情况下使用时,它会下载可能使用旧版本 xcodebuild 构建的预构建框架。
Alternative way is to use carthage update --no-use-binaries
. This way it will compile all the frameworks with the latest Xcode build installed on your Mac.
另一种方法是使用carthage update --no-use-binaries
. 这样,它将使用 Mac 上安装的最新 Xcode 版本编译所有框架。
回答by Tungkay
I am using cocoapods.I just right-click the wrong framework,show it in Finder,remove it,and build the project again,solve the problem.
我用的是cocoapods,我只是右键单击错误的框架,在Finder中显示它,将其删除,然后重新构建项目,解决问题。
回答by Umit Kaya
You can try rebuilding the framework by command line:
您可以尝试通过命令行重建框架:
- Open Terminal
- cd project/directory
- carthage build
- 打开终端
- cd 项目/目录
- 迦太基建造
then clean the xcode project and run!
然后清理xcode项目并运行!