
[英]Xcode12 - building for iOS Simulator, but linking in object file built for macOS, file 'dir/SomeFile.a' for architecture x86_64
[英]Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture x86_64
有 Xcode 错误信息:
在 FFmpeg/Classes/lib/libavcodec.a(aacencdsp.o) 中,为 iOS 模拟器构建,但链接为独立构建的目标文件,文件 'FFmpeg/Classes/lib/libavcodec.a' 用于体系结构 x86_64。
我的库文件 libavcodec.a 支持 x86_64、i386、arm64、armv7 arm7 等。
我在Podfile
设置了以下代码,然后pod install
但没有工作。
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
我遇到了同样的问题,我在 Xcode 12 版中尝试了这个
在 package.json 中将 react-native-ffmpeg 版本更改为 0.4.4
即“反应原生ffmpeg”:“0.4.4”
更新库
从你的项目根目录“npm install”
清理 react-native-ffmpeg pod 缓存
光盘
pod 缓存清理 react-native-ffmpeg --all
更新 [ios] 文件夹中的 pod 文件。
用下面的替换包含 react-native-ffmpeg 的行
pod 'react-native-ffmpeg/https-lts', :path => '../node_modules/react-native-ffmpeg'
安装 Pod
光盘
吊舱安装
清理您的应用程序构建文件夹。
在 Xcode 中打开您的项目并按 (⇧⌘K) 之前清理您的构建。 或 -> 在 Xcode 中转到(产品 => 清理构建文件夹)。
✅ 现在从 Xcode 运行您的应用程序。
参考: https : //github.com/tanersener/react-native-ffmpeg/issues/196#issuecomment-700935317 Salehjarad 评论
把它放在 Podfile 的末尾:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings[‘EXCLUDED_ARCHS[sdk=iphonesimulator*]’] = ‘arm64’
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64' end end
基本上你可能必须这样做:
我想你会在这里找到你的答案https://stackoverflow.com/a/63955114/2864316
基本上,您需要从模拟器构建中排除 arm64 架构。 您可以手动执行此操作,也可以按照链接答案中的详细说明更改 pod 文件。
至少那个答案解决了我的问题👍
我遇到过同样的问题。 我使用 react-native,但是 react-native-ffmpeg 依赖于 mobile-ffmpeg。 我的解决方案是使用 LTS 版本的包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.