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

Expo项目集成React Native Firebase Analytics遇x86_64架构符号未定义错误

解决Expo自定义开发客户端添加RN Firebase Analytics后iOS模拟器构建x86_64符号缺失问题

以下是未尝试过的针对性解决步骤:

  • 调整Firebase Pods的架构配置
    模拟器x86_64架构缺失符号,大概率是Firebase Analytics的Pod未包含该架构。在ios/Podfile末尾添加如下配置:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        if target.name.start_with?('Firebase')
          target.build_configurations.each do |config|
            config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64 arm64'
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
          end
        end
      end
    end
    

    执行命令彻底重建Pods依赖:

    cd ios && pod deintegrate && pod install
    

    返回项目根目录重新运行expo run:ios。

  • 重新执行带清理的Expo预构建
    单纯删除ios目录不够,需要用Expo官方预构建清理命令重新生成原生目录:

    expo prebuild --clean
    

    这会确保Firebase Analytics的原生依赖被正确注入到iOS项目中。

  • 统一RN Firebase库版本
    检查package.json中所有@react-native-firebase/*相关包的版本,确保Analytics和Firestore、Auth等库版本完全一致。版本不兼容会导致链接阶段符号匹配失败。统一版本后重新安装依赖:

    rm -rf node_modules package-lock.json
    npm install
    
  • 彻底清理全链路缓存
    清除所有可能的缓存残留:

    # 清除Expo缓存
    expo r -c
    # 清除CocoaPods缓存
    cd ios && pod cache clean --all
    

    再重新执行依赖安装和构建。

  • 修复签名团队配置
    错误提示的占位符团队ID问题虽不直接导致符号缺失,但会影响构建稳定性。在app.json的ios字段中添加teamId:

    "ios": {
      "bundleIdentifier": "你的包名",
      "teamId": "你的开发团队ID"
    }
    

    或者打开iOS项目的.xcworkspace,在Signing & Capabilities面板中选择正确的开发团队。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 15:57:15