36
votes

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
Could you please post your full Podfile? I suspect I have the answer. - Peter Brooks

14 Answers

78
votes

I had a similar issue.

Your import statement would be:

import Firebase

Make sure restart Xcode and to clean the build folder.

It's working for me & got rid of "Use of unresolved identifier FirebaseApp..." error

Update: For Swift 4.2: FirebaseApp.configure() does work. [FIRApp is renamed to FirebaseApp]

50
votes
import FirebaseCore

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

27
votes

Sounds like you might be using an older version of Firebase. Try -

pod repo update
pod update

Double check Firebase 4.0 is being installed.

Also try importing the specific modules. So instead of import Firebase use import FirebaseDatabaseor import FirebaseAuth.

14
votes

use FIRApp.configure() instead of Firebase.configure()

8
votes
sudo gem install cocoapods
pod update
6
votes

Replace pod 'Firebase/Core' with pod 'Firebase'. Then run pod repo update.

5
votes

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

4
votes

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

2
votes

I put in 'Firebase' along w/ 'Firebase/Core' in the podfile and it worked for me

1
votes

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.

1
votes

Use FIRApp.configure() instead of FirebaseApp.

1
votes

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

import FirebaseRemoteConfig

helped in my case

1
votes

import FirebaseCore

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

FirebaseCore version: 6.29.0

1
votes

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.