How to Fix 'Undefined Symbols for Architecture arm64' in Flutter?
Introduction Experiencing build errors in Flutter, especially when targeting iOS, can be frustrating. One common error that developers encounter is the 'Undefined symbols for architecture arm64.' This specific error often arises after upgrading tools, such as migrating from Xcode 15 to Xcode 16. In this article, we'll explore the reasons behind this error, particularly focusing on how it relates to Firebase dependencies and gRPC, and we'll provide comprehensive solutions to resolve it. Why Does This Error Occur? The 'Undefined symbols for architecture arm64' error typically occurs when your project is unable to locate certain symbols at compile time. In this case, the symbols mentioned include: _GRPC_ASN1_STRING_to_UTF8 _GRPC_BIO_free _GRPC_BIO_free_all These symbols are part of gRPC, a framework that facilitates remote procedure calls, which is often utilized by Firebase dependencies like firebase_core and firebase_auth in Flutter projects. Although you might not be using gRPC directly, it's incorporated within the Firebase libraries that your application relies on, which is likely why you're facing this issue after upgrading to Xcode 16. Steps to Fix 'Undefined Symbols for Architecture arm64' Step 1: Clean Your Build Before diving into more complex solutions, it's a good practice to clean your project to remove any cached files that might lead to conflicts. Open your terminal. Navigate to your Flutter project directory. Run the following commands: flutter clean flutter pub get Step 2: Update Firebase Dependencies Sometimes, compatibility issues arise due to outdated packages. Ensure your pubspec.yaml file is updated with the latest versions of Firebase dependencies. Open pubspec.yaml. Look for any Firebase packages. Make sure they are on the latest version. Here’s an example of how you might include Firebase packages: dependencies: flutter: sdk: flutter firebase_core: ^latest_version firebase_auth: ^latest_version Save the file and run: flutter pub get Step 3: Modify Build Settings for Xcode Customizing your Xcode project settings can resolve many build issues related to architecture. Here’s what to do: Open the ios folder of your Flutter project in Xcode. Click on your project in the Project Navigator, then select the target for your app. Navigate to Build Settings. Locate the Architectures section and ensure that the Architectures setting is set to $(ARCHS_STANDARD). Under Excluded Architectures, consider setting arm64 to Yes for Any iOS Simulator SDK. This step is particularly helpful because it will let you run your app on simulators without conflicts. Step 4: Rebuild Your Project After making the above adjustments, it's time to rebuild your app in Xcode: Select your device/simulator target from the top bar. Click on the Build button or press Command + B to build the app again. Step 5: Check Podfile and Update CocoaPods Ensure that CocoaPods is up to date, as outdated pods can create compatibility issues. In your terminal, navigate to the ios folder of your Flutter project. Update CocoaPods: pod repo update pod install Frequently Asked Questions (FAQ) Q1: Why does my Flutter app build fine in Xcode 15 but not in Xcode 16? A1: This is typically due to changes or enhancements in Xcode 16 that affect how certain dependencies are built or linked. It's important to update your dependencies and check build settings accordingly. Q2: Do I need to use gRPC directly to encounter these errors? A2: No, you don't need to use gRPC directly. Many Firebase packages internally rely on gRPC, which can lead to these symbol errors when there are compatibility issues. Q3: Will reverting to Xcode 15 solve the problem? A3: While reverting to Xcode 15 might temporarily fix the issue, it’s advisable to resolve compatibility with Xcode 16 to ensure your app remains future-proof and can take advantage of new features. Conclusion Encountering the 'Undefined symbols for architecture arm64' error when building a Flutter app is more common than you might think, especially after upgrading Xcode versions. By following the steps outlined in this article—cleaning your build, updating dependencies, adjusting Xcode settings, and ensuring proper CocoaPods configuration—you can successfully resolve this issue and continue your Flutter development journey without interruptions.

Introduction
Experiencing build errors in Flutter, especially when targeting iOS, can be frustrating. One common error that developers encounter is the 'Undefined symbols for architecture arm64.' This specific error often arises after upgrading tools, such as migrating from Xcode 15 to Xcode 16. In this article, we'll explore the reasons behind this error, particularly focusing on how it relates to Firebase dependencies and gRPC, and we'll provide comprehensive solutions to resolve it.
Why Does This Error Occur?
The 'Undefined symbols for architecture arm64' error typically occurs when your project is unable to locate certain symbols at compile time. In this case, the symbols mentioned include:
_GRPC_ASN1_STRING_to_UTF8
_GRPC_BIO_free
_GRPC_BIO_free_all
These symbols are part of gRPC, a framework that facilitates remote procedure calls, which is often utilized by Firebase dependencies like firebase_core
and firebase_auth
in Flutter projects. Although you might not be using gRPC directly, it's incorporated within the Firebase libraries that your application relies on, which is likely why you're facing this issue after upgrading to Xcode 16.
Steps to Fix 'Undefined Symbols for Architecture arm64'
Step 1: Clean Your Build
Before diving into more complex solutions, it's a good practice to clean your project to remove any cached files that might lead to conflicts.
- Open your terminal.
- Navigate to your Flutter project directory.
- Run the following commands:
flutter clean flutter pub get
Step 2: Update Firebase Dependencies
Sometimes, compatibility issues arise due to outdated packages. Ensure your pubspec.yaml
file is updated with the latest versions of Firebase dependencies.
- Open
pubspec.yaml
. - Look for any Firebase packages. Make sure they are on the latest version. Here’s an example of how you might include Firebase packages:
dependencies: flutter: sdk: flutter firebase_core: ^latest_version firebase_auth: ^latest_version
- Save the file and run:
flutter pub get
Step 3: Modify Build Settings for Xcode
Customizing your Xcode project settings can resolve many build issues related to architecture. Here’s what to do:
- Open the
ios
folder of your Flutter project in Xcode. - Click on your project in the Project Navigator, then select the target for your app.
- Navigate to Build Settings.
- Locate the Architectures section and ensure that the Architectures setting is set to
$(ARCHS_STANDARD)
. - Under Excluded Architectures, consider setting
arm64
toYes
for Any iOS Simulator SDK. This step is particularly helpful because it will let you run your app on simulators without conflicts.
Step 4: Rebuild Your Project
After making the above adjustments, it's time to rebuild your app in Xcode:
- Select your device/simulator target from the top bar.
- Click on the Build button or press
Command + B
to build the app again.
Step 5: Check Podfile and Update CocoaPods
Ensure that CocoaPods is up to date, as outdated pods can create compatibility issues.
- In your terminal, navigate to the
ios
folder of your Flutter project. - Update CocoaPods:
pod repo update pod install
Frequently Asked Questions (FAQ)
Q1: Why does my Flutter app build fine in Xcode 15 but not in Xcode 16?
A1: This is typically due to changes or enhancements in Xcode 16 that affect how certain dependencies are built or linked. It's important to update your dependencies and check build settings accordingly.
Q2: Do I need to use gRPC directly to encounter these errors?
A2: No, you don't need to use gRPC directly. Many Firebase packages internally rely on gRPC, which can lead to these symbol errors when there are compatibility issues.
Q3: Will reverting to Xcode 15 solve the problem?
A3: While reverting to Xcode 15 might temporarily fix the issue, it’s advisable to resolve compatibility with Xcode 16 to ensure your app remains future-proof and can take advantage of new features.
Conclusion
Encountering the 'Undefined symbols for architecture arm64' error when building a Flutter app is more common than you might think, especially after upgrading Xcode versions. By following the steps outlined in this article—cleaning your build, updating dependencies, adjusting Xcode settings, and ensuring proper CocoaPods configuration—you can successfully resolve this issue and continue your Flutter development journey without interruptions.