简体   繁体   中英

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

There is Xcode error info:

in FFmpeg/Classes/lib/libavcodec.a(aacencdsp.o), building for iOS Simulator, but linking in object file built for free standing, file 'FFmpeg/Classes/lib/libavcodec.a' for architecture x86_64.

My library file libavcodec.a supports x86_64, i386, arm64, armv7 arm7 and so on.

I have set below code in Podfile , then pod install but didn't work.

config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'

I had the same issue, i tried this for Xcode version 12

Change your react-native-ffmpeg version to version 0.4.4 in your package.json

ie "react-native-ffmpeg": "0.4.4"

Update the library

"npm install" from your project root directory

Cleaning react-native-ffmpeg pod caches

cd ios

pod cache clean react-native-ffmpeg --all

Update your pod file in [ios] folder.

replace the line containing react-native-ffmpeg with the below

pod 'react-native-ffmpeg/https-lts', :path => '../node_modules/react-native-ffmpeg'

Installing Pod

cd ios

pod install

Cleaning your app build folder.

Open your project in Xcode and press (⇧⌘K) to clean your build before. OR -> in Xcode go to (Product => Clean build folder).

✅ Now run your app from Xcode.

Reference: https://github.com/tanersener/react-native-ffmpeg/issues/196#issuecomment-700935317 Salehjarad comment

Put this at the end of the 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

Basically you may have to do:

  1. Main project target
  2. Pod project target

I think you will find your answer here https://stackoverflow.com/a/63955114/2864316

Basically you need to exclude the arm64 architecture from simulator builds. You can do this manually, or change your pod file as detailed in the linked answer.

At least that answer fixed my issue 👍

I had the same issue. I use react-native, but react-native-ffmpeg depend on mobile-ffmpeg. Solution for me was to use the LTS version of package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM