[Fixed] In M1 Machine Ventura13.3 – Xcode 14.3 build error with UnDefined Symbol on all Pods framework – Xcode

by
Ali Hasan
apple-m1 axios ios16.4 xcode xcode14.3

The Problem:

When building an existing project in Xcode 14.3 on an M1 Mac running Ventura 13.3, undefined symbol errors occur for all Pods frameworks.

Previously, building with the Rosetta option enabled in Xcode 14.2 resolved the issue. However, in Xcode 14.3, this option is deprecated.

Updating the Podfile to set the deployment target to 11.0 and re-running ‘pod install’ also fails with an error.

Attempting to follow the instructions provided by Apple to resolve build errors results in an error popup window. Selecting the ‘Build for Rosetta’ option allows the project to build successfully, but the simulator name changes to Rosetta.

The goal is to build the app without using Rosetta on an M1 machine.

The Solutions:

Solution 1: Control visibility of architecture-specific run destinations

To resolve the "UnDefined Symbol" error with Xcode 14.3 on M1 machines running Ventura 13.3, you can control the visibility of architecture-specific run destinations:

  1. In the Xcode menu bar, select Product > Destination, and then choose Show Both. This will display both Intel and Apple Silicon simulators.
  2. Build your project for the desired architecture. For example, if you want to build for Apple Silicon, select an Apple Silicon simulator.
  3. Your project should build successfully without encountering the "UnDefined Symbol" error.

Solution 2: Updating Build Settings for iOS 16.4 Deployment Target

To build your app without Rosetta on an M1 machine running Ventura 13.3 and Xcode 14.3, update the following build settings:

  1. Navigate to Build Settings within Xcode.
  2. Set IPHONEOS_DEPLOYMENT_TARGET to 16.4.
  3. Set VALID_ARCHS to arm64.
  4. Set CURRENT_ARCH to arm64.

These changes ensure that your app is built specifically for Apple Silicon devices and targets iOS 16.4. By updating your Podfile as mentioned in the problem statement, you can update the targets for your Pods as well.

Once these settings are updated, you should be able to build and run your app on an M1 machine without the need for Rosetta.

Q&A

How do I work my app in an M1 machine without building with Rosetta?

Select the menu Product > Destination, and choose show both architecture simulators

Is right to build an app with Rosetta in 14.3?

No, it is not recommended to build an app with Rosetta in 14.3