8
votes

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'
4
Do you get this error from an SDK or is it from your code? I have the same error while using braintree SDKDemoDemo
I have the same issue with GoogleSignIn "building for iOS Simulator, but linking in object file built for iOS, file '/Volumes/.../Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' for architecture arm64" but only when building with xcodebuildRand
I got the same error while using xxx.a static libraries. The lib architectures are armv7 i386 x86_64 arm64William Hu
I have the same error. How did you solve it?jocoders

4 Answers

1
votes

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

-1
votes

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 👍

-1
votes

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.

-1
votes

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