React Native on Apple Silicon M1 - the Linked Library 'Libpods-Projectname.A' Is Missing One or More Architectures Required by This Target: X86_64

React Native on Apple Silicon M1 - The linked library 'libPods-ProjectName.a' is missing one or more architectures required by this target: x86_64

I had the same issue and finally, I fixed it. There are 2 main reasons for the errors:

  1. arm64 architecture support & and Xcode 12 compatible version have not been provided by many popular third party libraries yet (like Firebase, AFNetworking, etc). Xcode 11 used to automatically translate building for arm64 for the simulator into building for x86_64, but now that arm64 is a valid simulator architecture (it’s the Apple Silicon architecture), that translation no longer occurs.

  2. Because the Valid Architectures build setting has been removed from Xcode 12, the Project file, opened in Xcode 12, will auto-generate a VALID_ARCHS macro in User-Defines, and this macro will make the build fail.

I follow all steps in this post: https://medium.com/@khushwanttanwar/xcode-12-compilation-errors-while-running-with-ios-14-simulators-5731c91326e9

Final step was updating all pods by running below command inside the project folder:

pod deintegrate
pod update

Then I exclude the arm64 for the Simulator architecture, both from main project and the Pod project.

Xcode build settings

Clean the project ( + + k) then run.

The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target: x86_64

I had the same issue on my M1 Mac and here is what I did to fix this:

  1. sudo arch -x86_64 gem install ffi
  2. add this code at the end of the pod file which is inside ios folder:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
end
end
end

  1. cd ios/ && arch -x86_64 pod install.

  2. run Xcode with Rosetta.

    Sample Image.

    You can install Rosetta by running: softwareupdate --install-rosetta

  3. exclude architecture arm64.
    Sample Image

  4. clean build - open xcode then press Command + Shift + K




  1. If you're using nvm try to replace NODE_BINARY=node with the actual result of the which node command, which in my case looks something like this:Sample Image

    Sample Image

Shoutout to these answers:
one two three



Related Topics



Leave a reply



Submit