Xcode Error Building for iOS Simulator because of Architecture arm64

The Apple M1 is an ARM-based chip. Because M1’s architecture is different from the previous Intel x86 one, Resetta 2 permits many applications compiled for x86–64 processors to be translated for execution on Apple silicon.

Bram Yeh
2 min readOct 15, 2022

TL;DR

I suggest using Rosetta to launch Xcode.

  1. Right-click on Xcode in your applications folder and click “Get Info”.
  2. Check the “Open using Rosetta”.

With MacBook Pro with M1, Xcode runs the iOS projects but gets the following error:

error build: In
.../Pods/GoogleAppMeasurement/Frameworks/GoogleAppMeasurement.framework/GoogleAppMeasurement, building for iOS Simulator, but linking in object file built for iOS, file ‘.../Pods/GoogleAppMeasurement/Frameworks/GoogleAppMeasurement.framework/GoogleAppMeasurement’ for architecture arm64

Initially, I thought this was because I didn’t update the Xcode or SDK version, but even after updating to the latest version, I still got the same error.

Option 1

Most of my research is to set excluded architectures for the simulator to arm64. It means we exclude arm64 for the simulator architecture.

For me, because the error comes from GoogleAppMeasurement, so I changed “Excluded Architectures” in my PODS project only, not the target of the main project. But in most cases, we might do this modification in both the target project and the Pod project.

To do that, we can refer the https://stackoverflow.com/questions/63607158/xcode-building-for-ios-simulator-but-linking-in-an-object-file-built-for-ios-f

To do that, navigate to Build Settings of your project and add Any iOS Simulator SDK with value arm64 inside Excluded Architecture.

Option 2

Use Rosetta to launch Xcode.

The Apple M1 is an ARM-based chip. Because M1's architecture is different from the previous Intel x86 one, Resetta 2 permits many applications compiled for x86–64 processors to be translated for execution on Apple silicon. So it makes apps that have not been optimized on M1 also work smoothly on M1.

About this error, the Xcode looks not 100% perfect at M1, so we can resolve this issue by using Rosetta to launch Xcode.

Although this option can make Xcode build normally (with the Rosetta 2 translator), it might have a performance loss.

Reference:

https://stackoverflow.com/questions/63607158/xcode-building-for-ios-simulator-but-linking-in-an-object-file-built-for-ios-f

--

--