Skip to content Skip to sidebar Skip to footer

Firebase Firestore Getinstance Failing On Android

I am unable to obtain an instance of Firebase Firestore on Android.This line of code below fails repeatedly. FirebaseFirestore db = FirebaseFirestore.getInstance(); It throws java

Solution 1:

The project ID is read from the google-services.json file.

Make sure you have a recent google-services.json file and are using com.google.gms:google-services:3.1.0 or higher (not 3.0.0).

Solution 2:

Try updating your implementation 'com.google.firebase:firebase-firestore:17.0.2' That's that latest currently. Please check your firebase console for the most recent version

Solution 3:

changing the project gradle google services worked forme thanks

just by adding in the project gradle, under dependencies

dependencies {

    classpath 'com.google.gms:google-services:4.2.0'

}

Solution 4:

Copy project_id from google-services.json to string.xml then it works fine.

Post a Comment for "Firebase Firestore Getinstance Failing On Android"