Firebase (4.0.0): Use of unresolved identifier FirebaseApp when installing FirebaseDatabase

Viewed 26407

This is what happens:

  • running on Xcode Version 7.3.1 (7D1014)
  • pod 'Firebase/Core'
  • import Firebase in the Class

unresolved on Database

Then I added the Database framework

  • pod 'Firebase/Core'
  • pod 'Firebase/Database'

unresolved on FirebaseApp

It seems that the 2 frameworks are in mutex mode. They cannot coexist.

I have tried everything: update, install, uninstall, recreate the project, recreate the workspace. All.

May you help me. Is there a bug on last Firebase release?

14 Answers
import FirebaseCore

Then you could use FirebaseApp.configure(). I'm using swift 4.

That work today for me:

1. in Xcode 9.1

import UIKit
import Firebase
import UserNotifications
import FirebaseInstanceID
import FirebaseMessaging
import FirebaseCrash
import FirebaseAnalytics


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        FirebaseApp.configure()

        return true
    }

2. My PodFile

pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'Firebase/Crash'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Storage'
  pod 'FirebaseUI', '~> 4.0'
  pod 'Firebase/Auth'
  pod 'Firebase/Messaging'

3. finale:

pod repo update
pod update

4. restart xcode:

5. press: shift-alt-command-k (in xcode)

This will delete all of the products and intermediate files in the build folder.It's different from delete derive data.

6. an clean

done

In my case it I needed to import FirebaseCore instead of import Firebase or import FirebaseRemoteConfig.

It worked for me with

pod repo update
pod update

and then run this at the location of the pod file:

pod install

After rebuilding my app the error should be gone.

Use FIRApp.configure() instead of FirebaseApp.

For those facing the issue with RemoteConfig configuration, adding an extra import:

import FirebaseRemoteConfig

helped in my case

import FirebaseCore

Adding this to the top of the class resolved the issue for me.

FirebaseCore version: 6.29.0

This is probably too late but if you are sure your podfile is correct and your app has been building before. When this error just comes out of the blue, remember that the other thing can go wrong is your Xcode's incremental build folder.

Try this:

  1. Quite Xcode
  2. Locate your Build folder and DerivedData folder in finder
  3. Delete Build folder and DerivedData folder
  4. Rebuild via Xcode

Hopefully you'd be fine then.

Related