【问题标题】:Error in installing the 'Firebase/Crashlytics' pod in Swift在 Swift 中安装“Firebase/Crashlytics”pod 时出错
【发布时间】:2020-07-23 03:00:26
【问题描述】:

我正在将 pod 'Firebase/Crashlytics' 安装到我的 Xcode 项目中。 项目配置为: X代码:10.3 斯威夫特版本:4.2 Pod 版本:1.8.0.beta.2

pod 安装后出错:

[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In snapshot (Podfile.lock):
    Firebase/CoreOnly (= 6.4.0)

  In Podfile:
    Firebase/Auth was resolved to 6.4.0, which depends on
      Firebase/CoreOnly (= 6.4.0)

    Firebase/Crashlytics was resolved to 6.15.0, which depends on
      Firebase/CoreOnly (= 6.15.0)

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

我的 podfile 中的其他 pod:

# Uncomment the next line to define a global platform for your project

pod 'SwifterSwift'
pod 'AlamofireNetworkActivityIndicator'
pod 'ReachabilitySwift'
pod 'IQKeyboardManagerSwift'
pod 'Nuke'
pod 'FlagPhoneNumber'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
pod 'SDDownloadManager'
pod 'Cosmos', '~> 18.0'
pod 'Socket.IO-Client-Swift', '~> 13.2.0'
pod 'SwiftyJSON', '= 4.0'
pod 'AppImageViewer'
pod 'MDGroupAvatarView'
pod 'OpalImagePicker'
pod 'KMPlaceholderTextView', '~> 1.4.0'
pod 'CropViewController'
pod 'GrowingTextView', '0.6.1'
pod 'Firebase/Crashlytics'
end

【问题讨论】:

  • 我建议删除Firebase/Core

标签: swift firebase cocoapods


【解决方案1】:

改变

pod 'Firebase/Core'

pod 'Firebase/CoreOnly'

已编辑:

对于我来说,我已经在 Podfile 中指定了 pod 版本,所以我必须在我的 Podfile 中更改这一行。

【讨论】:

  • 虽然这可能会回答问题,但一篇好的帖子将包含有关更改内容和原因的更多详细信息。
  • 我已经阅读了@Suhas 发布的错误。他想安装依赖于Firebase/CoreOnlyFirebase/Crashlytics,因此他需要更改为使用“Firebase/CoreOnly”而不是“Firebase/Core”。 :)
【解决方案2】:

这是由于 pod 的不同版本而出现的问题,因为旧的 firebase pod 未更新,并且安装了默认的新 pod 使用更高版本。

安装新 pod 并更新旧 pod

  1. 我们必须更新可可豆荚
  2. 更新特定 pod,以免干扰其他 pod

【讨论】:

    【解决方案3】:

    只需几步

    第 1 步:Firebase/CoreOnly pod 更新

    pod update 'Firebase/CoreOnly'
    

    第 2 步:pod 安装

    pod install
    

    【讨论】:

      【解决方案4】:

      对我来说,这是旧版本的额外行

      pod 'Firebase', '6.13.0'
      

      只需删除该行即可解决问题。或者您可以将版本更改为最新版本。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-01-07
        • 2020-04-27
        • 2013-08-15
        • 1970-01-01
        • 2021-02-11
        • 2020-08-13
        相关资源
        最近更新 更多