Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

xcode12

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'
like image 484
Xun Avatar asked Sep 22 '20 04:09

Xun


1 Answers

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

like image 198
Haymouz Avatar answered Jan 02 '23 09:01

Haymouz