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

Mac Mini环境下Flutter项目因Firebase/Database版本冲突无法构建求助

解决Flutter项目中CocoaPods依赖版本冲突问题

方案1:升级flutter_geofire到兼容高版本Firebase的分支/版本

  • 查看flutter_geofire的代码仓库,确认是否有支持Firebase 10.x的更新分支或发布版本。如果有,修改pubspec.yaml中的依赖配置:
    flutter_geofire:
      git:
        url: https://github.com/对应仓库地址.git
        ref: 兼容Firebase 10.x的分支名称
    
  • 执行flutter pub get拉取新依赖,再重新运行arch -x86_64 pod install。

方案2:降级firebase_database到兼容GeoFire 4.1.0的版本

  • 去pub.dev查询firebase_database的历史版本,找到依赖Firebase/Database ~6.0的版本号,修改pubspec.yaml:
    firebase_database: ^兼容6.x的版本号
    
  • 执行flutter pub get,然后清理Pod缓存并重新安装:
    rm -rf ios/Pods
    rm ios/Podfile.lock
    arch -x86_64 pod install
    

方案3:手动修改Podfile强制统一版本

  • 在ios/Podfile中添加代码,强制指定Firebase/Database为双方可能兼容的版本(优先尝试找中间兼容版本,若不存在则只能选前两个方案):
    pod 'Firebase/Database', '~> 6.0'
    
  • 执行arch -x86_64 pod install完成安装。

方案4:替换flutter_geofire为维护活跃的替代插件

  • 若flutter_geofire长期未更新,可替换为支持最新Firebase的GeoFire相关插件(如针对Firestore的geofirestore),修改pubspec.yaml中的依赖后重新执行依赖安装流程。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 21:52:34