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

使用@react-native-firebase/firestore时iOS出现BoringSSL-GRPC.modulemap缺失错误

iOS端@react-native-firebase/firestore模块映射缺失问题解决方案

以下是针对该问题的可行解决步骤,按顺序尝试:

  • 清理CocoaPods环境重新安装

    1. 删除iOS目录下的Podfile.lock和Pods文件夹:
      rm ios/Podfile.lock
      rm -rf ios/Pods
      
    2. 清空CocoaPods本地缓存:
      pod cache clean --all
      
    3. 回到iOS目录重新执行安装:
      cd ios && pod install
      
  • 锁定依赖版本避免冲突
    在ios/Podfile中手动指定BoringSSL-GRPC和gRPC-Core的稳定版本,添加以下代码到Podfile中:

    pod 'BoringSSL-GRPC', '~> 0.0.23'
    pod 'gRPC-Core', '~> 1.54.0'
    

    保存后重新执行pod install

  • 检查Xcode头文件搜索路径配置

    1. 打开Xcode,选中项目Target,进入Build Settings页面
    2. 搜索Header Search Paths,确保包含$(inherited)
    3. 添加路径$(PODS_ROOT)/Headers/Private/openssl_grpc,并设置为recursive模式
  • 切换CocoaPods版本
    1.9.0版本可能存在兼容性问题,尝试升级到稳定版本:

    sudo gem install cocoapods -v 1.15.2
    

    升级完成后重新执行pod install

  • 调整静态链接配置
    修改ios/Podfile中的静态链接配置,同时添加Firebase相关框架的编译参数:

    use_frameworks! :linkage => :static
    
    pre_install do |installer|
      installer.pod_targets.each do |pod|
        if pod.name.start_with?('Firebase') || pod.name.start_with?('GoogleUtilities')
          pod.build_configurations.each do |config|
            config.build_settings['OTHER_LDFLAGS'] ||= []
            config.build_settings['OTHER_LDFLAGS'] << '-ObjC'
          end
        end
      end
    end
    

    保存后重新执行pod install,再尝试编译项目

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.14 00:03:18