[Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture...

简介: [Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture...
背景: xcode版本:12.5xcode macos版本:11.2.2 (20D80)
遇到问题:用模拟器打开项目报上面如下错误,链接不到第三方,缺少架构arm64架构
[Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

cocoapods

新公司,用了新Mac开发。但是cocoapods集成第三方的时候报错了

LoadError - dlsym(0x7ff521754650, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

查阅资料后是发现M1芯片的锅,顺序执行如下代码,问题得以解决

sudo arch -x86_64 gem install ffi
 arch -x86_64 pod install

模拟器

早期模拟器只支持x86架构

真机对应arm64等

现在M1芯片,模拟器架构从x86变成了arm架构

而很多静态库对模拟器只有x86架构

导致出现运行在M1芯片里,模拟器是arm架构,导致变异链接时,找不到对应的架构从而报错!

解决方案

1.让第三方支持M1芯片架构
2.自己在xcode debug模式下剔除arm64架构

在Build Settings 搜索Exclude 增加上arm64架构

我是采取方案2解决问题的,图如下。

image.png

截屏2021-03-09 下午2.21.03.png


目录
打赏
0
0
0
0
367
分享
相关文章
uniapp开发ios打包Error code = -5000 Error message: Error: certificate file(p12) import failed!报错问题如何解决
uniapp开发ios打包Error code = -5000 Error message: Error: certificate file(p12) import failed!报错问题如何解决
204 67
uniapp开发ios打包Error code = -5000 Error message: Error: certificate file(p12) import failed!报错问题如何解决
解决Xcode运行IOS报错:redefinition of module ‘Firebase‘和could not build module ‘CoreFoundation‘
解决Xcode运行IOS报错:redefinition of module ‘Firebase‘和could not build module ‘CoreFoundation‘
355 4
解决xcode doesn‘t support iphone’s ios 14.6 (18f72)
解决xcode doesn‘t support iphone’s ios 14.6 (18f72)
381 3
|
8月前
|
mac不通过Xcode直接打开IOS模拟器
mac不通过Xcode直接打开IOS模拟器
336 24
iOS自动化测试方案(二):Xcode开发者工具构建WDA应用到iphone
这篇文章是iOS自动化测试方案的第二部分,详细介绍了在Xcode开发者工具中构建WebDriverAgent(WDA)应用到iPhone的全过程,包括环境准备、解决构建过程中可能遇到的错误,以及最终成功安装WDA到设备的方法。
425 0
iOS自动化测试方案(二):Xcode开发者工具构建WDA应用到iphone
iOS自动化测试方案(一):MacOS虚拟机保姆级安装Xcode教程
这篇文章提供了一份保姆级的教程,指导如何在MacOS虚拟机上安装Xcode,包括环境准备、基础软件安装以及USB扩展插件的使用,以实现iOS自动化测试方案的第一步。
482 0
iOS自动化测试方案(一):MacOS虚拟机保姆级安装Xcode教程
|
8月前
|
IOS编译报错‘ZipArchive.h‘ file not found|Use of undeclared identifier ‘SSZipArchive‘
IOS编译报错‘ZipArchive.h‘ file not found|Use of undeclared identifier ‘SSZipArchive‘
138 1
如何在Xcode删除某个版本的IOS模拟器
如何在Xcode删除某个版本的IOS模拟器
786 1
nginx安装提示 libssl.so.3: cannot open shared object file: No
【8月更文挑战第1天】### 原因 未将安装的ssl中的`libssl.so.3`链接到`/usr/lib`导致缺失。 ### 解决方案 1. 检查openssl是否已安装,若为低版本则需重装。 ```sh whereis openssl
3447 6
|
10月前
|
技术好文:xcode动态图,ios实现动态图,iosgif,暂停和继续播放
技术好文:xcode动态图,ios实现动态图,iosgif,暂停和继续播放
124 24

热门文章

最新文章