未声明Firebase参考 [英] Firebase References undeclared
问题描述
我创建了一个新的Xcode项目,将"Firebase" pod添加到我的pod文件中并安装了它,并根据Firebase文档添加了Google-services.plist文件和其余的文件.
I created a new Xcode project, added the 'Firebase' pod to my pod file and installed it, and added the Google-services.plist file and the rest according to the Firebase documentation.
导入Firebase 工作正常,但如果我尝试
import Firebase works fine, but if I try
var ref:FIRDatabaseReference!
在同一个ViewController中,则会引发错误:
in the same ViewController, then it throws an error:
使用未声明的类型'FIRDatabaseReference'
Use of undeclared type 'FIRDatabaseReference'
对于任何Firebase参考,都会发生这种情况.有什么想法吗?我是Swift和xCode IDE的新手.
And this happens for any Firebase References. Any ideas on this? I am very new to Swift and the xCode IDE.
推荐答案
遇到了同样的问题,但是过了一会儿,我意识到我在Pod文件中缺少一个条目,您的Pod文件应该包含:>
Just had the same problem, but after a while I realized that I was missing an entry in the pod-file, your pod-file should contain:
pod 'Firebase/Database'
希望它现在可以工作:)
Hope it works now :)
这篇关于未声明Firebase参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!