5

I have installed this three pods in my native iOS Swift/ObjC App:

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'

Here is call of config method:

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    FirebaseApp.configure()
    return true
}

I have this message in logs:

[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https ....

I don't know where is problem. I see similar in the Internet, but related with technologies like: React Native, Cordova, Flutter ... Any one have idea what happens in my native project?

I have double checked Google Info Plist files and configuration in the console and I have never had this type of behavior before.

Xcode Version 11.2.1 (11B500)

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

3 Answers3

0

This could happen if the app is calling Firebase APIs in a +load or +initialize method. More details at https://stackoverflow.com/a/23992142/556617

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
  • Nope. I have configuration at `application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool` – Paweł Łoziński Jan 08 '20 at 12:50
0

This error is logged because the app is trying to access FirebaseApp.app() before it is configured. Jump to definition to app() (or defaultApp for Objective-C) function in Firebase SDK and add a breakpoint there to see where this function is called.

You can see the error from Firebase SDK here: https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCore/Sources/FIRApp.m#L235-L241

Samet DEDE
  • 1,621
  • 19
  • 28
-3

This solution worked for me https://stackoverflow.com/a/64046033/9682885

Just add this line in your AppDelegate

FirebaseApp.configure()

Paloma Bispo
  • 312
  • 3
  • 9