CocoaPods 未将 Firebase SDK 更新到版本 4.0.0 [英] CocoaPods not updating Firebase SDK to Version 4.0.0

查看:17
本文介绍了CocoaPods 未将 Firebase SDK 更新到版本 4.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 Swift 项目更新为 Firebase 的新 SDK 版本 4.0.0 使用 CocoaPods(按照文档的建议),但更新后的 SDK 似乎没有即使我按照文档中的步骤进行安装.

I am trying to update my Swift project to Firebase's new SDK Version 4.0.0 using CocoaPods (as suggested by the documentation) but the updated SDK does not seem to be installing even when I follow the steps in the documentation.

谁能帮助我了解为什么这不起作用以及我可以做些什么来更新到新的 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,我认为它应该是):

When I run pod install I get this seemingly promising output (except that it is not version 4 as I think it should be):

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 编写的,例如:

I can tell it isn't updating to the most recent SDK as well because the new firebase documentation does not match the functions that work in my project. My project is in Swift, so for example:

作品

FIRApp.configure()

不起作用(但文档建议)

Does not work (but is suggested by documentation)

FirebaseApp.configure()

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

I did try these solutions as well:

推荐答案

你原来的 Podfile 没有任何问题 ;) 你只是把 pod install 混淆了>pod update——你运行的是前者,但你应该使用后者.一个简单的概述来澄清事情:

There was nothing wrong with your original Podfile ;) You are just confusing pod install with pod update — you were running the former but you should be using the latter instead. A brief overview to clear things up:

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

pod install. When you run pod install, it only resolves dependencies for pods that are not already listed in the Podfile.lock. For pods in Podfile.lock, it downloads the explicit version listed there, without checking if a newer version is available — I believe this (expected) behavior was causing your issue.

pod 更新.如果您运行 pod update,CocoaPods 会将您的 Podfile 中列出的每个 pod 更新为可能的最新版本.当然,如果有的话,请尊重 Podfile 中声明的版本限制.

pod update. If you run pod update, CocoaPods will update every pod listed in your Podfile to the latest version possible. Of course, respecting the version restrictions declared in your Podfile, if any.

有关更多信息,请务必查看 pod 安装与 pod更新指南.

For more information, be sure to check the pod install vs. pod update guide as well.

这篇关于CocoaPods 未将 Firebase SDK 更新到版本 4.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆