在 Swift 中安装“Firebase/Crashlytics”pod 时出错

Suh*_*til 10 cocoapods firebase swift

我正在将 pod 'Firebase/Crashlytics' 安装到我的 Xcode 项目中。项目配置为:XCode:10.3 Swift 版本: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`.
Run Code Online (Sandbox Code Playgroud)

我的 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
Run Code Online (Sandbox Code Playgroud)

Nim*_*wat 8

改变

pod 'Firebase/Core'
Run Code Online (Sandbox Code Playgroud)

pod 'Firebase/CoreOnly'
Run Code Online (Sandbox Code Playgroud)

编辑:

就我而言,我已经在 Podfile 中指定了 pod 版本,所以我必须在我的 Podfile 中更改这一行。

  • 我已阅读@Suhas 发布的错误。他想要安装依赖于“Firebase/CoreOnly”的“Firebase/Crashlytics”,因此他需要更改为使用“Firebase/CoreOnly”而不是“Firebase/Core”。:) (2认同)

Suh*_*til 5

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

安装新的 pod 并更新旧的 pod

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

在此处输入图片说明