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

Error in installing the 'Firebase/Crashlytics' pod in Swift

I am installing the pod 'Firebase/Crashlytics' into my Xcode project. the project configuration is: XCode: 10.3 Swift Version: 4.2 Pod Version: 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`.

我的播客文件中的其他 pods:

# 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

This is issue was coming due to diff version of pods because the old firebase pods were not updated and the default new pod are installed with a higher version.

安装新的 pod 并更新旧的 pods

  1. 我们必须更新 cocoa-pods
  2. 更新特定 pods 以免打扰其他 pods

改变

pod 'Firebase/Core'

pod 'Firebase/CoreOnly'

已编辑:

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

只需几步

第 1 步:Firebase/CoreOnly 广告连播更新

pod update 'Firebase/CoreOnly'

第 2 步:pod 安装

pod install

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

pod 'Firebase', '6.13.0'

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