I am totally new to Firebase and building iOS apps. In Xcode 7, I am trying to import Firebase into my Swift class. In a swift file, I have typed \"import Firebase\".
When using the CocoaPods installation method, you can start by removing the project workspace file:
rm -rf MyProject.xcworkspace
Then, edit the Podfile to following, which will be automatically set for the latest version of Firebase:
use_frameworks!
target 'MyProject' do
pod 'Firebase/Core'
pod 'Firebase/Database'
end
target 'MyProjectUITests' do
pod 'Firebase/Core'
pod 'Firebase/Database'
end
Finally, reinstall the pod
pod install
If you have added the firebase framework manually, delete it and add it again.Rebuild the project and it will work.
There seems to be a bug.This happens when you discard the changes.
In your Podfile make sure to have pod 'Firebase' in addition to your pod 'Firebase/Core' After, :wq from vim and run a command pod update
. Make sure to open .xcworkspace
Those who are using swift 3
are welcome to try this. It worked for me.
My pod file:
platform :osx, '9.0'
use_frameworks!
target 'MyProject' do
pod 'Firebase/Messaging'
pod 'Firebase'
end
AppDelegate:
import FirebaseCore
import FirebaseMessaging
For me it was this:
The Framework is called FirebaseAnalytics now and not Firebase.
The official documentation even has this wrong.
So after installing with CocoaPods (Firebase version 3.4.0) this works:
import FirebaseAnalytics