The Default App Has Not Been Configured Yet

The default app has not been configured yet

Here's the answer to your problem:

To configure Firebase you have to execute FIRApp.configure() somewhere. After this is done you can use let firebaseDatabaseReference = FIRDatabase.database().reference() to get a reference to that database and start using it. The problem isn't with Firebase "per se" but with how Swift behaves.

If you put FIRApp.configure() in your AppDelegate func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool and then in the MyDatabase class you use let firebaseDatabaseReference = FIRDatabase.database().reference() outside of your declared functions sometimes the code FIRDatabase.database().reference() executes before the application didFinishLaunchingWithOptions function is executed.

Essentially your class is trying to get a reference to the Firebase database before it has a chance to configure itself, generating the error in the console "The default app has not been configured yet."

Note: This doesn't happen all the time, sometimes the application is slow to start, in iOS Simulator for example, and it doesn't have a chance to finish before MyDatabase "let" executes and tries to get a reference.

That is why moving the FIRApp.configure() code to override init() in AppDelegate works, essentially it makes sure the configure code gets executed when AppDelegate is initialised (in this and most cases, before MyDatabase is initialised)

override init() {
super.init()
FIRApp.configure()
// not really needed unless you really need it FIRDatabase.database().persistenceEnabled = true
}

Also make sure you super.init() (so you super classes get the "message") so you override doesn't do more harm than good.

Error with Firebase 4.0 - 'The default Firebase app has not yet been configured' though FirebaseApp.configure() seems correct

You may have already seen this, but I thought I should show you instead until I can get home and look how mine is setup: The default app has not been configured yet

That might be the correct place to add it, but you may be referencing the database (or Firebase) somewhere else before it has been configured.

The default Firebase app has not yet been configured when it has - Swift

Try to call let db = Firestore.firestore() and let userID = Auth.auth().currentUser!.uid inside the viewDidLoad method

another solution will be to write :

lazy var db = Firestore.firestore()
lazy var userID = Auth.auth().currentUser!.uid

Why is my Flutter Application is showing App with name __FIRAPP_DEFAULT does not exist.

In your AppDelegate.swift, make sure you've added the following in that order

FirebaseApp.configure() //add this before the code below
GeneratedPluginRegistrant.register(with: self)

If you're using flutter with objective-c, add the following

didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure]; //add this right after the above

My Flutter/Firebase app is showing no app has been configured yet

I solved the issue. If you are using swift in your AppDelegate.swift, make sure you've added the following in that order:

FirebaseApp.configure() //add this before the code below
GeneratedPluginRegistrant.register(with: self)

If you're using flutter with objective-c, add the following to your appdelgate.m file:-

didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure]; //add this right after the above

Xcode Console saying Firebase is not configured

There was a problem with the plist file, after replacing it everything worked fine. Thank you to everyone who helped.

Cordova ios-The default Firebase app has not yet been configured

The file GoogleService-Info.plist should not be created manually. Instead, you download this file from Firebase Console, after you can a project and an ios app inside this project. Do not forget to place the file with the root of your Cordova app



Related Topics



Leave a reply



Submit