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

标签 ios swift firebase sdk cocoapods

我正在尝试将我的 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/

相关文章:

ios - 使用 Firebase 分页时重复按键

ios - UITextField 在输入数字的最后添加 3 个零阻止输入

ios - 如何将collectionview单元设置为从索引 '1'而不是 '0'开始 - Swift

android - 无法确定任务 ':app:uploadCrashlyticsMappingFileRelease' 与 Google 版本 4.3.9 的依赖关系

c++ - Apple 的 SpeakHere 演示,混合了 ObjC 和 C++,以及翻译单元

ios - 如何处理未知方案,对 webview 不执行任何操作?

objective-c - 导航栏设置为不可见,但单击后退按钮时会出现

ios - 这个 Objective C self.navigationController 有什么问题?

swift - 在 firestore 上自动更新的计时器

javascript - 无法连接到 Firebase(JS)