Xcode 12,为 iOS 模拟器构建,但链接为 iOS 构建的目标文件,用于架构 x86_64

Xun*_*Xun 8 ios xcode12

有 Xcode 错误信息:

在 FFmpeg/Classes/lib/libavcodec.a(aacencdsp.o) 中,为 iOS 模拟器构建,但链接为独立构建的目标文件,文件 'FFmpeg/Classes/lib/libavcodec.a' 用于体系结构 x86_64。

我的库文件 libavcodec.a 支持 x86_64、i386、arm64、armv7 arm7 等。

我已经在 中设置了下面的代码Podfilepod install但是没有用。

config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
Run Code Online (Sandbox Code Playgroud)

小智 -1

将其放在 Podfile 的末尾:

\n
post_install do |installer|\n  installer.pods_project.build_configurations.each do |config|\n    config.build_settings[\xe2\x80\x98EXCLUDED_ARCHS[sdk=iphonesimulator*]\xe2\x80\x99] = \xe2\x80\x98arm64\xe2\x80\x99\n
Run Code Online (Sandbox Code Playgroud)\n

config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'\nend\nend

\n

基本上你可能需要这样做:

\n
    \n
  1. 主要项目目标
  2. \n
  3. Pod 项目目标
  4. \n
\n