CocoaPods 找不到 pod“FirebaseCore”的兼容版本:在快照中 (Podfile.lock)

Posted

技术标签:

【中文标题】CocoaPods 找不到 pod“FirebaseCore”的兼容版本:在快照中 (Podfile.lock)【英文标题】:CocoaPods could not find compatible versions for pod "FirebaseCore": In snapshot (Podfile.lock) 【发布时间】:2019-02-01 15:09:13 【问题描述】:

我正在尝试添加我在 GitHub 上找到的 Geofirestore pod,这样我就可以在社交媒体应用程序中的帖子中添加地理位置经度和纬度。我的 pod 文件看起来像这样

pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage', '~> 4.0'
pod 'Geofirestore'

我在终端中运行了 pod repo update 和 pod install ,但它无法正常工作,我将其视为错误。

[!] CocoaPods could not find compatible versions for pod "FirebaseCore":
  In snapshot (Podfile.lock):
    FirebaseCore (= 4.0.20, ~> 4.0)

  In Podfile:
    Firebase/Core was resolved to 4.13.0, which depends on
      FirebaseAnalytics (= 4.2.0) was resolved to 4.2.0, which depends on
        FirebaseCore (~> 4.0)

    Firebase/Core was resolved to 4.13.0, which depends on
      FirebaseCore (= 4.0.20)

    Geofirestore was resolved to 0.1.0, which depends on
      FirebaseCore (~> 5.0.3)

[!] Automatically assigning platform `ios` with version `11.4` on target `My App` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform

【问题讨论】:

【参考方案1】:

您的 Podfile 中有 'Geofirestore':如错误消息所示,它需要 FirebaseCore (~> 5.0.3)

您的 Podfile 中有 'Firebase/Storage', '~> 4.0',它会将您固定到 FirebaseCore (~> 4.0)

要同时使用两者,您需要从 Firebase 4 升级到 Firebase 5。即你需要:

pod 'Firebase/Storage', '~> 5.0'

【讨论】:

啊,我忘了拥有一个旧版本的 pod for firebase 也会影响其余部分。非常感谢,我会更新我的 firebase pod。 很高兴我不知道!

以上是关于CocoaPods 找不到 pod“FirebaseCore”的兼容版本:在快照中 (Podfile.lock)的主要内容,如果未能解决你的问题,请参考以下文章

Cocoapods:找不到“PRIVATE POD”依赖的“PUBLIC POD”规范

Flutter:CocoaPods 找不到 pod“Firebase/Messaging”的兼容版本

Cocoapods:找不到“Firebase/Core”的规范

CocoaPods 找不到 pod "React/Core" 的兼容版本

CocoaPods 找不到 pod “5.0.0-beta.1” 的兼容版本

CocoaPods 找不到 pod“UMCore”的兼容版本