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

Flutter Windows端升级cloud_firestore至4.13.0版本依赖冲突问题

解决Cloud Firestore v4.13+与Firebase Core Desktop的版本冲突问题

核心解决方案

移除firebase_core_desktop的直接依赖——最新版firebase_core已内置桌面平台支持,单独依赖该包会导致版本冲突。

操作步骤

  1. 编辑项目根目录下的pubspec.yaml文件:
    • 删除firebase_core_desktop: any这一行
    • 将firebase_core及其他Firebase依赖更新为与cloud_firestore兼容的版本,示例配置如下:
      firebase_core: ^2.24.2 
      firebase_analytics: ^10.8.0 
      firebase_auth: ^4.16.0 
      google_sign_in: any 
      google_mobile_ads: any
      cloud_firestore: ^4.14.0 
      
  2. 执行依赖安装命令:
    flutter pub get
    
  3. 若缓存导致问题未解决,清除缓存后重新安装:
    flutter pub cache clean
    flutter pub get
    

冲突原因说明

Cloud Firestore v4.10+要求firebase_core_platform_interface v5.0.0,但firebase_core_desktop最新稳定版(1.0.2)仅依赖firebase_core_platform_interface v4.5.0,二者依赖版本不兼容。同时,firebase_core从v2.10版本开始已原生支持Windows等桌面平台,无需再单独引入firebase_core_desktop,保留该依赖只会引发版本冲突。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.02 00:12:53