无法安装Firebase / InAppMessagingDisplay:它们需要更高的最低部署目标

时间:2018-11-15 11:20:28

标签: xcode firebase cocoapods firebase-in-app-messaging

我正在尝试使用Firebase应用内消息传递,只是在Podfile中添加了几行。
但是,当我运行pod install时,下面显示了一条错误消息:

[!] CocoaPods could not find compatible versions for pod "Firebase/InAppMessagingDisplay":
  In Podfile:
    Firebase/InAppMessagingDisplay

Specs satisfying the `Firebase/InAppMessagingDisplay` dependency were found, but they required a higher minimum deployment target.

我也尝试过pod install --repo-update,但是遇到了同样的错误。
如何安装吊舱?

我的cocoapod是1.5.3,而Xcode是10.1。
这是我的Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'

target 'iOSTestApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for iOSTestApp
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'  
  pod 'Firebase/DynamicLinks'
  pod 'Firebase'
  pod 'Firebase/InAppMessagingDisplay'

  target 'iOSTestAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

pod outdated的结果:

- Firebase 4.4.0 -> (unused) (latest version 5.12.0)
- FirebaseAnalytics 4.0.4 -> 5.3.0 (latest version 5.3.0)
- FirebaseCore 4.0.9 -> 5.1.7 (latest version 5.1.7)
- FirebaseDynamicLinks 2.1.0 -> 3.1.1 (latest version 3.1.1)
- FirebaseInstanceID 2.0.5 -> 3.3.0 (latest version 3.3.0)
- FirebaseMessaging 2.0.5 -> 3.2.1 (latest version 3.2.1)
- GoogleToolboxForMac 2.1.3 -> (unused) (latest version 2.1.4)
- nanopb 0.3.8 -> 0.3.901 (latest version 0.3.901)
- Protobuf 3.4.0 -> 3.6.1 (latest version 3.6.1)

3 个答案:

答案 0 :(得分:0)

InAppMessaging需要Firebase5.x。进行pod update,以便您现有的Pod可以更新到其当前安装的版本之后。

答案 1 :(得分:0)

这就是我所做的。

pod 'Firebase'
pod 'Firebase/Core'
pod 'FirebaseMessaging' #, '~> 2.0.5'
pod 'Firebase/DynamicLinks'
pod 'Firebase/InAppMessagingDisplay'

保存podfile。

  1. 退出xCode
  2. 删除Pods文件夹和Podfile.lock
  3. 运行pod install --verbose
  4. 如果问题已解决,那就很好。

其他步骤它将更新您所有的Pod

  1. pod更新

希望有帮助。

答案 2 :(得分:0)

开始之前,您需要在环境中进行一些设置:

  • 启用了Firebase的应用:如果尚未添加,请添加Firebase to your iOS project
  • Xcode 9.2或更高版本:Firebase应用内消息传递需要相对较新版本的Xcode才能运行。您可以在Apple's Xcode site.
  • 中找到最新的Xcode版本。
  • CocoaPods 1.4.0或更高版本:Firebase应用内消息传递使用CocoaPods管理对iOS的依赖关系。您可以从CocoaPods site安装它。

还有另一件事,请使用 pod更新“ Firebase” 更新Firebase SDK,然后在Pod文件中添加 Firebase / InAppMessagingDisplay 依赖项。

在终端中执行 pod install 命令后,它将开始安装。

相关问题