Default Firebaseapp Is Not Initialized

Default FirebaseApp is not initialized

I had this same issue some time ago.

You're trying to get an instance of Firebase without initialize it.
Please add this line of code before you try to get an instance of Firebase, in your main function or a FutureBuilder:

FirebaseApp.initializeApp();

Default FirebaseApp is not initialized in this process ... Make sure to call FirebaseApp.initializeApp(Context) first

I used multi-module in this project. id com.google.gms.google-services to app directory and solved.

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.example.bottomnav

You probably did not add the google-services plugin to your build.gradle. It's more than just a dependency. According to the documentation, you also have to add:

apply plugin: 'com.google.gms.google-services'

Java.Lang.IllegalStateException Default FirebaseApp is not initialized

I finally figured it out, I just had to follow the steps here:

Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first

Side note: for step 2, this other article explains how to do it:

https://forums.xamarin.com/discussion/175159/i-didnt-find-googleservices-json-in-the-build-action

Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first

Make sure:

  1. Package name in AndroidManifest.xml is identical to one in the google-services.json
  2. google-services.json build action is set to GoogleServicesJson
  3. After step 2 restart your IDE & clean & rebuild
  4. Explicitly call FirebaseApp.InitializeApp(Application.Context); in MainActivity.OnCreate just before the LoadApplication(..)


Related Topics



Leave a reply



Submit