skip to Main Content

I have recently updated the com.google.gms:google-services:4.4.0 dependency, and after that, it started crashing my app. The cause was listed as ‘Initialize the Firebase.’ However, when I downgraded the version of com.google.gms:google-services, it works fine. Please help me with this issue.

Carsh log

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.myproject.activity. Make sure to call FirebaseApp.initializeApp(Context) first. at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:179) at com.google.firebase.messaging.FirebaseMessaging.getInstance(FirebaseMessaging.java:126) at com.myproject.activity.MainActivity.onCreate(MainActivity.java:478)

I am trying to update the dependency, and i have alredy initialized firebase in my project in the Application class like this

FirebaseApp.initializeApp(this);

2

Answers


  1. Chosen as BEST ANSWER

    Update: I was able to resolve the issue by following the suggestion provided by firebase support team. The problem arose after updating the com.google.gms:google-services dependency to version 4.4.0, causing my app to crash with the error 'Initialize the Firebase.'

    Upon further investigation, I found that updating the Android Gradle Plugin version to 8.1.0, as recommended, fixed the problem. I appreciate the assistance and hope this solution helps others facing a similar issue.


  2. Try call Init() at Application.attachContext, not Application.onCreate?

    add some log to show the order of calls.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search