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

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

问题描述

我正在尝试将我的Swift项目更新到 Firebase的新SDK版本4.0.0 <使用CocoaPods(根据文档建议),但更新的SDK似乎并不即使按照文档中的步骤进行安装。



任何人都可以帮助我理解为什么这不起作用,我可以做什么来更新到新的Firebase SDK?

我的Podfile

 #取消注释此行为您的项目定义全局平台
platform:ios,'9.2'
#如果您使用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,我认为它应该是):

$ b使用Alamofire(4.4.0)
安装Firebase 3.17.0(是3.17。
$ b $ pre $
安装Firebase 3.17.0(是3.17。 0)
使用FirebaseAnalytics(3.9.0)
使用FirebaseAuth(3.1.1)
使用FirebaseCore(3.6.0)
使用FirebaseCrash(1.1.6)
使用Firebase数据库(3.1.2)
使用FirebaseInstanceID(1.0.10)
使用FirebaseMessaging(1.2.3)
使用FirebaseStorage(1.1.0)
使用GTMSessionFetcher(1.1.9 )
使用GoogleToolboxForMac(2.1.1)
使用Protobuf(3.3.0)
生成Pods项目
集成客户端项目
发送统计信息
Pod安装完成! Podfile有8个依赖关系,安装了13个总共的窗格。

我可以告诉它没有更新到最近的SDK,因为新的firebase文档不匹配在我的项目中工作的功能。我的项目在Swift中,例如:

Works

  FIRApp.configure()

不起作用(但由文档建议

  FirebaseApp.configure()

这些解决方案也是如此:


解决方案

你原来的 Podfile ;)你只是把 pod install pod update - 你正在运行前者,但你应该使用后者。



pod安装。当您运行 pod install 时,它仅 解决了 Podfile.lock code>。对于 Podfile.lock 中的pod,它会下载列在那里的显式版本,而不检查是否有新版本可用 - 我相信这行为是造成你的问题。

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

有关更多信息,请务必检查 pod安装与pod更新指南也是如此。

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.

Can anyone help my understand why this is not working and what I can do to update to the new Firebase SDK?

My 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

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.

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:

Works

FIRApp.configure()

Does not work (but is suggested by documentation)

FirebaseApp.configure()

I did try these solutions as well:

解决方案

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.

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 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.

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天全站免登陆