Cannot Import Firebase into Swift Class

Cannot import Firebase in Swift app

You shouldn't need to use a Bridging Header.

The Firebase SDK uses Swift module mapping, so you'll have to let CocoaPods know.

Use this podfile:

use_frameworks! # this allows you to use import Firebase
pod 'Firebase', '>= 2.5.0'

Then you should be able to use import Firebase in any Swift file.

Sometimes after opening from CocoaPods install, XCode can get confused. Do a Cmd+K to clean and a Cmd+Shift+R to rebuild. If that still is giving you errors, then restart Xcode and try the clean and build again.

Cannot import Firebase sdk in Swift app

The Firebase SDK heavily changed on May 16, 2016. This changed the names of the pods and their respective functionality.

The new pod name for the standard Firebase SDK is Firebase/Core, which includes only Firebase Analytics. If you're upgrading from the old Firebase system, you probably only need these:

pod 'Firebase/Core'      # Firebase Analytics
pod 'Firebase/Database' # Firebase Realtime Database
pod 'Firebase/Auth' # Firebase Authentication

If you're using other Firebase functionality, refer to https://firebase.google.com/docs/ios/setup for other podnames. Don't forget that regardless of what you choose, you need to include Firebase/Core.



Related Topics



Leave a reply



Submit