【问题标题】:Getting "CocoaPods could not find compatible versions for pod "Firebase/Database" " Error on flutter获取“CocoaPods 找不到 pod“Firebase/Database”的兼容版本“颤振错误
【发布时间】:2021-05-03 13:50:29
【问题描述】:

我已按照有关如何在我的项目中设置 geofire 的确切指南进行操作。我在我的 android 项目上取得了成功.. 但我无法让它为 ios 运行.. 当我尝试运行它时它有以下错误。

[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
  In Podfile:
    firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.1.2, which depends on
      Firebase/Database (= 7.11.0)

    flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1, which depends on
      GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
        Firebase/Database (~> 6.0)

我尝试运行pod update,结果如下

Macbook-MBP:ios Macbook$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
firebase_auth: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
  In Podfile:
    firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to                             
    6.1.2, which depends on Firebase/Database (= 7.11.0)

    flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1,
     which depends on
  GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
    Firebase/Database (~> 6.0)

这就是我导入到我的 pubspec.yaml 文件中的内容..

  firebase_database: ^6.1.2
  flutter_geofire: ^2.0.0

我不明白我做错了什么,任何帮助将不胜感激..谢谢

【问题讨论】:

  • 有人可以帮忙吗?
  • 我希望。我遇到了同样的问题。
  • @Eric 检查发布的答案
  • 谢谢@Danny!

标签: firebase flutter cocoapods geofire


【解决方案1】:

对于面临此问题的任何人,

  1. 在终端中运行flutter clean
  2. 在 podfile 的底部添加这一行
    pod 'GeoFire', :git => 'https://github.com/mrdishant/geofire-objc', :tag => '4.3.0'
  3. 不要忘记在 podfile 顶部添加 use_frameworks!
  4. 从 iOS 中删除 Pod 文件夹。
  5. 在 podfile 上将 platform :ios, '10.0' 更改为 platform :ios, '11.0'
  6. 运行pod repo update 然后pod update
  7. 然后在终端中运行flutter run

这就是我如何让它为我工作

【讨论】:

    【解决方案2】:

    将 Podfile 中配置的平台更新为 platform :ios, '10.0' 对我不起作用。我不得不将 iOS 部署目标更新为 10.0 - 位于 Runner > Info > Deployment Target

    之后,使用 rm -rf Podfile.lock 删除 Podfile.lock 然后运行 ​​pod updatepod install 为我解决了这个问题。

    【讨论】:

      【解决方案3】:

      这里也是同样的问题。几周以来我一直在努力修复。网上也找不到东西。如果你弄清楚了,请发帖!抱歉,我还没有足够的“声望点”来发表评论:(

      【讨论】:

        猜你喜欢
        • 2022-11-02
        • 2020-02-15
        • 1970-01-01
        • 2021-05-07
        • 2021-04-01
        • 2019-09-27
        • 1970-01-01
        • 2019-02-23
        • 2019-09-28
        相关资源
        最近更新 更多