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

执行pod install遇依赖冲突:GTMSessionFetcher/Core与GoogleMaps版本不兼容

iOS Pod Install 依赖冲突解决方案(Firebase/GoogleMaps相关)

一、解决GTMSessionFetcher版本冲突(RNFBAuth与RNGoogleSignin)

  • 查找两个依赖共同兼容的GTMSessionFetcher版本(可通过查看两者的发布文档确定重叠版本范围),在Podfile中强制锁定该版本:
    pod 'GTMSessionFetcher/Core', '2.1.0' # 替换为实际兼容版本
    
  • 添加预安装钩子,阻止其他依赖篡改该版本:
    pre_install do |installer|
      installer.pod_targets.each do |pod|
        if pod.name == 'GTMSessionFetcher'
          pod.version = '2.1.0' # 与上面锁定的版本保持一致
        end
      end
    end
    

二、解决react-native-google-maps与GoogleMaps版本矛盾

  • 查看react-native-google-maps官方文档,确认它支持的GoogleMaps版本,在Podfile中锁定对应版本:
    pod 'GoogleMaps', '6.2.0' # 替换为react-native-google-maps兼容的版本
    
  • 若问题仍存在,修改react-native-google-maps的Pod引用,开启模块化头文件:
    pod 'react-native-google-maps', :path => '../node_modules/react-native-google-maps', :modular_headers => true
    

三、进阶排查与清理步骤

  • 完全卸载现有Pods:pod deintegrate
  • 清理Pod缓存:pod cache clean --all
  • 检查package.json中相关依赖版本:确保react-native-firebase、react-native-google-signin、react-native-google-maps的版本与你的React Native版本互相兼容(例如react-native-firebase v18需要RN 0.71+)
  • 重新执行安装:pod install --repo-update

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.23 00:12:43