报错building for iOS Simulator, but linking in object file built for iOS

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

Coderliszt

2021.04.24 22:33:37字数 277阅读 1,158

<article class="_2rhmJa">

这个M1芯片下Xcode 编译错误的解决方案
Xcode版本12.3
M1芯片的Macbook pro

在选中模拟器进行编译的时候会报如下类似错误。

building for iOS Simulator, but linking in object file built for iOS, file 'xxx/Pods/WechatOpenSDK/WeChatSDK1.8.5/libWeChatSDK.a' for architecture arm64

这个问题目前应该只出现在M1芯片的Mac上似乎又是一个兼容性问题因为M1芯片的Mac本身就是arm架构所以模拟器自然也支持arm架构。。。
目前的解决方案是在编译设置中对模拟器排除 arm64

第一步在项目的编译设置中添加排除说明

image

第二步在podfile添加以免pod install时覆盖需要在pod工程中的设置

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        end
    end
end

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6