building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64

Xcode 13
M1 Macboook Pro
使用模拟器编译iOS项目报 building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64 的错误。

从报错上看,M1 电脑上的模拟器是arm架构的,但是link的framework是Simulator-x86_64,所以报错。

lipo info 查看了framework支持的架构,是支持arm64的。

需要做如下设置:

Build Settings -> Excluded Architectures

building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64_第1张图片
参考:Xcode 12, building for iOS Simulator, but linking in an object file built for iOS, for architecture ‘arm64’ : https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-an-object-file-built-for-io

你可能感兴趣的:(#,SDK开发,#,App开发,ios,xcode,objective-c)