You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity集成Firebase后Xcode打包Archive遇arm64符号缺失错误求助

Troubleshooting Firebase Unity iOS Linker Errors (Manual Framework Import)

Let’s walk through targeted fixes for the arm64 undefined symbols error you’re seeing when archiving your Unity-Firebase iOS app (without CocoaPods):

1. Confirm All Required Firebase Native Frameworks Are Included

Since you’re using Firebase’s C++ SDK (evidenced by libFirebaseCppApp.a and similar libraries), you must import the corresponding Objective-C Firebase frameworks to resolve these missing symbols:

  • Add these frameworks to your Xcode project’s Frameworks, Libraries, and Embedded Content:
    • FirebaseApp.framework
    • FirebaseAuth.framework
    • FirebaseDatabase.framework
    • Ensure all Firebase frameworks are set to Embed & Sign (critical for linking during archive)
  • Double-check that the version of these Objective-C frameworks exactly matches your Firebase Unity/C++ SDK version—version mismatches are a common cause of linking failures.

2. Validate Architecture Support for All Libraries

  • Verify your imported Firebase frameworks support arm64:
    Run this terminal command on each framework to check supported architectures:
    lipo -info /path/to/your/FirebaseApp.framework/FirebaseApp
    
    Confirm arm64 is listed in the output.
  • Ensure Unity’s exported libiPhone-lib.a also supports arm64 (the warning about _unwind_tester suggests it does, but it’s worth confirming with the same lipo command).

3. Fix Linker Flags and Search Paths

  • In Xcode’s Build Settings:
    • Add -lc++ to Other Linker Flags (Firebase’s C++ SDK depends on the C++ standard library, which is often omitted when manually linking).
    • If -ObjC alone didn’t work, try adding -force_load for each Firebase C++ static library, e.g.:
      -force_load $(PROJECT_DIR)/Libraries/libFirebaseCppApp.a
      -force_load $(PROJECT_DIR)/Libraries/libFirebaseCppAuth.a
      
    • Confirm Framework Search Paths includes the directory where you stored your Firebase frameworks, with recursive search enabled (e.g., $(PROJECT_DIR)/FirebaseFrameworks/**).

4. Add Missing System Frameworks

Your error references _OBJC_CLASS_$_GKLocalPlayer—this means you need to add Apple’s GameKit.framework to your Xcode project (required for Firebase Game Center auth). Add it via Frameworks, Libraries, and Embedded Content.

5. Clean Build Cache and Rebuild

  • Clear Xcode’s build cache: Go to Product > Clean Build Folder (hold Option to see this option).
  • Delete your project’s Derived Data (find the path in Xcode’s Preferences > Locations), then restart Xcode.
  • Test a regular build to a simulator or physical device first before attempting Archive—this can catch smaller linking issues before they block archiving.

6. Verify Unity Export Settings

  • In Unity’s Player Settings (Edit > Project Settings > Player > iOS):
    • Set Architecture to ARM64 (under Other Settings > Configuration).
    • Disable any app thinning or bitcode options temporarily (bitcode can sometimes interfere with manual framework linking).
  • Ensure your Firebase Unity SDK is up-to-date and compatible with the iOS frameworks you’re importing.

Final Check: Re-Download Firebase Frameworks

If all else fails, re-download the Firebase iOS SDK and Firebase C++ SDK for your target version. Manual imports can miss hidden dependency frameworks (like GoogleUtilities.framework or FirebaseCore.framework) that CocoaPods would handle automatically—ensure all nested dependencies are also added to your Xcode project.

内容的提问来源于stack exchange,提问作者Dor Dahan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 13:47:38