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

添加cloud_firestore后Flutter运行时CocoaPods依赖兼容问题求助

添加cloud_firestore依赖后flutter run报错,CocoaPods依赖版本冲突且配置无效

问题详情

在项目中添加cloud_firestore: ^4.17.3依赖后,执行flutter run时出现以下错误:

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone 14.

当前依赖配置

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.6
  flutter_osm_plugin: ^1.0.3
  intro_slider: ^4.2.1
  salomon_bottom_bar: ^3.3.2
  csv: ^5.0.0
  ml_dataframe: ^1.6.0
  latlong2: ^0.9.1
  flutter_map: ^6.1.0
  firebase_core: ^2.30.1
  firebase_auth: ^4.19.4
  cloud_firestore: ^4.17.3

已尝试的解决方法及结果

  • 执行pod repo update,问题未解决
  • 卸载并重新安装CocoaPods,问题未解决
  • 进入ios目录执行pod install,得到版本冲突错误:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In snapshot (Podfile.lock):
    Firebase/CoreOnly (= 10.24.0)

  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 2.31.0, which depends on
      Firebase/CoreOnly (= 10.25.0)

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
   You should run `pod update Firebase/CoreOnly` to apply changes you've made.
  • 按提示执行pod update Firebase/CoreOnly,安装完成但出现配置提示:
Pod installation complete! There are 7 dependencies from the Podfile and 30 total pods installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
  • 按照上述配置提示修改后问题仍未解决;尝试创建无自定义构建配置的新项目,添加cloud_firestore和firebase_auth依赖后,依然出现相同问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.24 14:18:27