我正在开发iOS项目(使用xcode 8 & swift 3)。我已经通过cocoapod安装了Firebase吊舱。这是我的荚:无法初始化Firebase
target 'myApp' do
pod 'Firebase', '~> 3.9'
end
然后我打开myApp.xcworkspace文件,该项目在Xcode打开。
然后我尝试通过初始化一个火力点实例:
let BASE_URL = "https://myapp-35211.firebaseio.com/"
// ERROR: Cannot call value of non-function type 'module<Firebase>'
let firebase = Firebase(url: "\(BASE_URL)")
(我有import Firebase
)
我试图用火力数据库。
为什么我得到上面的错误?
====== UPDATE =======
OK,我也跟着步骤初始化火力地堡(添加我的项目在火力地堡,下载GoogleService-Info.plist中&使用FIRApp.configure()
等)。现在,我得到这个错误:
为什么?
我Podfile是这样的:
target 'myApp' do
pod 'Firebase', '~> 3.9'
end
莫非这荚不包括Firebase/Database
???
=====再次更新=====
OK,加'Firebase/Database'
到Podfile解决了上述问题,但为什么'Firebase'
荚不包括Firebase/Database
?它不是'Firebase'
pod的子集吗?
你是否已经导入了firebase? – Arasuvel
你叫'FIRApp.configure()'在你的appdelegate? – KrishnaCA
另外,我觉得这个问题可能与此类似:http://stackoverflow.com/questions/37355824/error-setting-up-firebase-in-xcode – KrishnaCA