【发布时间】:2017-10-29 22:42:58
【问题描述】:
我正在尝试使用 CocoaPods (as suggested by the documentation) 将我的 Swift 项目更新为 Firebase's new SDK Version 4.0.0,但即使我关注 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()
我也尝试过这些解决方案:
【问题讨论】:
-
你有什么版本的 CocoaPods?,检查版本使用命令:“pod --version”。您应该使用最新版本!
-
@DiegoQ 我有 1.2.1 版(虽然想法不错;需要文档说明 CocoaPods 1.0.0 或更高版本,因此我可以看到在其他情况下这是一个问题)
-
也许 - pod repo 更新和重试
-
@PaulBeusterien 刚刚尝试了 pod repo update 并重新运行了 pod install。不走运,但无论如何感谢您的建议
-
在控制台运行“pod update”,然后再次“pod install”
标签: ios swift firebase sdk cocoapods