模块文件由较旧版本的编译器创建

vik*_*lla 28 xcode ios alamofire carthage

使用Carthage管理我的依赖项,一切都在模拟器中运行良好.

但是,在为设备构建时,我收到以下错误:

在此输入图像描述

Module File was created by an older version of the compiler; rebuild Alamofire and try again: .../DerivedData/Build/Products/Debug-iPhones...
Run Code Online (Sandbox Code Playgroud)

我尝试过其他人对类似问题的建议:删除我的派生数据,重新安装Carthage并重建框架.但是,错误一直存在.

Rah*_*iya 35

您使用的是正确版本的xcodebuild吗?你运行xcode-select -p时看到了什么?如果你想在Xcode 7中使用框架,应该指向Xcode 7.

删除所有派生数据 rm -rf ~/Library/Developer/Xcode/DerivedData/ && carthage build

此外,当您使用carthage update without --no-use-binaries选项时,它会下载预构建的框架,这些框架可以使用旧版本的xcodebuild构建.

替代方式是使用carthage update --no-use-binaries.这样,它将使用Mac上安装的最新Xcode版本编译所有框架.