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:
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 forx86_64
, but now thatarm64
is a valid simulator architecture (it’s the Apple Silicon architecture), that translation no longer occurs.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.
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:
sudo arch -x86_64 gem install ffi
- 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
cd ios/ && arch -x86_64 pod install
.run Xcode with Rosetta.
.
You can install Rosetta by running:softwareupdate --install-rosetta
exclude architecture arm64.
clean build - open xcode then press Command + Shift + K
- If you're using
nvm
try to replaceNODE_BINARY=node
with the actual result of thewhich node
command, which in my case looks something like this:
Shoutout to these answers:
one two three
Related Topics
Why Does My Uitableview "Jump" When Inserting or Removing a Row
Loop Through Subview to Check for Empty Uitextfield - Swift
How to Schedule Local Notification for the Following Scenario
Negative Spacer for Uibarbuttonitem in Navigation Bar on iOS 11
iOS in App Purchase: Test a Real Purchase Without Submitting to Apple
Will iOS Wake Up the Terminated App If It's Registered with Location for Uibackgroundmodes
iPhone Uitextfield Background Color
Modifying Ekparticipants (Attendees) in Eventkit Like Sunrise
Uicollectionview Scrolling in Both Directions
Remove Uisegmentedcontrol Separators Completely. (Iphone)
Repeat Image Horizontally and Vertically
Ios: Differencebetween -Init and -Viewload of a Viewcontroller
Complete List of iOS App Permissions
Touchesbegan, Touchesended, Touchesmoved for Moving Uiview
Open Target="_Blank" Links Outside of Uiwebview in Safari