Xcode exits with error code 65 — Missing linked library for one or more architectures required by this target — x86_64

This is a known React Native issue when developing for iOS devices on Apple Silicon (M1) Macs.

You can learn more about this issue by reading these threads:

Below, we’ll outline some steps you can take to resolve the issue.

Forcing Xcode and Terminal to open with Rosetta

Go to Finder > Applications. Right-click (Control + click) on Xcode. Select Get Info, and under General, check the box for Open using Rosetta.

applications-xcode

xcode-get-info

enable-rosetta-xcode

In Finder > Applications > Utilities, you’ll find the terminal application. Right-click (Control + click) on the terminal, select Get Info, and under General, enable Rosetta like you did for Xcode.

Excluding arm64 architecture

In the Build Settings for your React Native project, exclude the arm64 architecture. To do this, open the workspace file (your-project-name.xcworkspace) in the iOS folder of your React Native project.

Then follow these steps in Xcode:

  • 1 — Select your project in the Navigator panel.

  • 2 — Select your project’s target.

  • 3 — Select the Build Settings tab.

  • 4 — Search for the Excluded Architectures setting and exclude arm64 from the Debug and Release builds on Any iOS Simulator SDK.

exclude-architectures-xcode-build-settings

After this is done, you can clean your project with Xcode > Product > Clean Build Folder, and then rebuild the project.