8

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'
Pranav Kasetti
  • 8,770
  • 2
  • 50
  • 71
Xun
  • 81
  • 1
  • 2
  • Do you get this error from an SDK or is it from your code? I have the same error while using braintree SDK – DemoDemo Sep 22 '20 at 21:28
  • 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 xcodebuild – Rand Sep 23 '20 at 15:55
  • I got the same error while using `xxx.a` static libraries. The lib architectures are `armv7 i386 x86_64 arm64` – William Hu Sep 23 '20 at 16:29
  • I have the same error. How did you solve it? – jocoders Feb 24 '21 at 17:47

4 Answers4

1

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

Haymouz
  • 76
  • 6
-1

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
udk
  • 1
  • 2
  • 1
    Thx for your answer. However, it didn't work. My problem is `for architecture x86_64`, not arm64. I have done this as same as you say before. – Xun Sep 22 '20 at 05:45
-1

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

Rand
  • 165
  • 1
  • 1
  • 12
-1

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Dániel Boros
  • 381
  • 2
  • 14