gpt4 book ai didi

ios - CocoaPods 没有将 Firebase SDK 更新到版本 4.0.0

转载 作者:IT王子 更新时间:2023-10-29 05:13:42 27 4
gpt4 key购买 nike

我正在尝试将我的 Swift 项目更新为 Firebase's new SDK Version 4.0.0使用 CocoaPods ( as suggested by the documentation ) 但即使我按照 steps in the documentation 更新的 SDK 似乎也没有安装.

谁能帮助我理解为什么这不起作用以及我可以做些什么来更新到新的 Firebase SDK?

我的 Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '9.2'
# Uncomment this line if you're using Swift
use_frameworks!


target 'myProject' do

pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Crash'
pod 'Firebase/Messaging'


pod 'Alamofire', '~> 4.4'

end

当我运行 pod install 时,我得到了这个看似有希望的输出(除了它不是版本 4,我认为它应该是):

Analyzing dependencies
Downloading dependencies
Using Alamofire (4.4.0)
Installing Firebase 3.17.0 (was 3.17.0)
Using FirebaseAnalytics (3.9.0)
Using FirebaseAuth (3.1.1)
Using FirebaseCore (3.6.0)
Using FirebaseCrash (1.1.6)
Using FirebaseDatabase (3.1.2)
Using FirebaseInstanceID (1.0.10)
Using FirebaseMessaging (1.2.3)
Using FirebaseStorage (1.1.0)
Using GTMSessionFetcher (1.1.9)
Using GoogleToolboxForMac (2.1.1)
Using Protobuf (3.3.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed.

我可以看出它也没有更新到最新的 SDK,因为新的 firebase 文档与我项目中的功能不匹配。我的项目在 Swift 中,例如:

有效

FIRApp.configure()

不起作用(but is suggested by documentation)

FirebaseApp.configure()

我也尝试过这些解决方案:

最佳答案

您的原始 Podfile 没有任何问题;)您只是将 pod installpod update 混淆了——您运行的是前者,但是你应该改用后者。简要概述以澄清问题:

pod 安装。当您运行 pod install 时,它 解决尚未在 Podfile.lock 中列出的 pod 的依赖项。对于 Podfile.lock 中的 pod,它会下载那里列出的显式版本,而不检查是否有更新的版本可用——我相信这种(预期的)行为导致了您的问题。

广告连播更新。如果您运行 pod update,CocoaPods 会将您的 Podfile 中列出的每个 pod 更新到可能的最新版本。当然,尊重在您的 Podfile 中声明的版本限制(如果有的话)。

有关更多信息,请务必查看 pod install vs. pod update指导也是如此。

关于ios - CocoaPods 没有将 Firebase SDK 更新到版本 4.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44245602/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com