问题
今天把旧的 IOS 项目在 xcode12 上编译。原本的项目在 xcode11 上编译运行没有问题。IOS 项目上包含了 Objective-C 和 Swift 代码。通过 Pod 安装也没报错。当执行构建的时候,报了以下错误
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
和 Unable to load standard library for target 'arm64-apple-ios11.0'
解决
- 在 Build Settings 中的
Exclude Architecture
中的arm64
去掉
或者在 XCConfig 文件新增以下配置
EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
- 如果上述方法还没法解决的话,在
Podfile
中添加以下配置
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
如果还没解决,欢迎反馈,我会及时回复您!