2

I have tried to set up Firebase to work on Xcode using both the quick setup instructions and the manual alternate instructions on Firebase website.

When I used CocoaPods and followed the instructions on the quick setup page, I was able to import Firebase, but I was not able to reference Firebase inside the class. I got the error: Cannot call value of non-function type 'module' xcode

When I tried to set it up manually, I was not able to import or reference Fire base and I got the error: No such module 'Firebase'

4

2 回答 2

4

将我的项目更新到新版本的 Firebase 时,我遇到了同样的问题。在 Google I/O 上宣布了大量更改,因此需要进行大量更新。

听起来您可能正在使用旧版本的 Firebase 和新的 SDK。您应该使用 Firebase 3.0 完成所有工作。因此var rootRef = Firebase(url:"https://<YOUR-FIREBASE-APP>.firebaseio.com")现在将是var rootRef = FIRDatabase.database().reference()

查看设置指南:https ://firebase.google.com/docs/ios/setup#prerequisites (确保您没有查看旧文档!)。如果您想将代码从旧版 Firebase 转换为 3.0,请查看升级教程:https ://firebase.google.com/support/guides/firebase-ios#get_a_database_reference_numbered

于 2016-05-22T23:43:17.630 回答
0

您应该尝试手动将您的 podfile 编辑为:

use_frameworks!

pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'

我使用这些指令让它与 Xcode 7.3 一起工作。

于 2016-07-10T12:39:07.000 回答