Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase not working com.google.firebase.installations.FirebaseInstallationsException

I am working on an Android app, I was in a situation that I want to move the app to a new firebase project, so I removed the old firebase project and created a new one, then I added my app to that project. After that, no firebase functionalities are working.

I have firebase cloud messaging in my app, it was working but it's not working now, I am not receiving FirebaseMessagingService$onNewTokenand also I am using firestore as my back-end database. Inside my .addOnSuccessListener I am getting 0 documents back. It's not failing but returning no documents.

I thought might be a problem with firebase, so I created a test app in node.js and I try to fetch documents from firestore it's working fine.

The android app is not crashing, but checked the error log, and I am seeing the following log.

java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid@@20.1.1:54)
        at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid@@20.1.1:89)
        at com.google.firebase.iid.zzv.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations@@16.0.0:333)
        at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations@@16.0.0:280)
        at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
2020-03-05 21:18:49.022 23658-23666/app.spidy.cyberwire E/spidy.cyberwir: Something went wrong getting fds from adb. Retry!: Success
2020-03-05 21:20:11.198 23658-24183/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid@@20.1.1:54)
        at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid@@20.1.1:89)
        at com.google.firebase.iid.zzv.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations@@16.0.0:333)
        at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations@@16.0.0:280)
        at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
2020-03-05 21:22:41.287 23658-24278/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid@@20.1.1:54)
        at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid@@20.1.1:89)
        at com.google.firebase.iid.zzv.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations@@16.0.0:333)
        at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations@@16.0.0:280)
        at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
2020-03-05 21:27:11.330 23658-24399/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid@@20.1.1:54)
        at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid@@20.1.1:89)
        at com.google.firebase.iid.zzv.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations@@16.0.0:333)
        at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations@@16.0.0:280)
        at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
like image 258
Jeeva Avatar asked Mar 05 '20 15:03

Jeeva


7 Answers

If you have recently change your google-services.json file then just delete build folder from android project and re-build your project.

like image 58
Jeeva Avatar answered Oct 17 '22 20:10

Jeeva


I had the same problem because access to internet (wifi and mobile) was disabled

like image 35
Daniil Avatar answered Oct 17 '22 18:10

Daniil


I had the same problem (Failed to get FIS auth token) with firebase-messaging version 20.1.1 and 20.1.2. I've solved it by downgrading to 20.1.0.

It looks like Firebase team has some problems with these versions according to Release Notes: Warning: The following two library versions released with this update have known issues and should not be used: firebase-messaging v20.1.1 and firebase-iid v20.1.0.

like image 14
Lukas Novak Avatar answered Oct 17 '22 20:10

Lukas Novak


Firebase Android SDK updates on February 27 (M65) and afterwards introduced a new infrastructure service, the Firebase Installations SDK which comes with a dependency on the Firebase Installations API.
Firebase Installations requires valid Firebase options API key, project ID, and application ID (a.k.a. "appId") in order to successfully communicate with Firebase servers.

Errors during communication with the Firebase Installations API indicate invalid Firebase options or misconfigurations regarding API keys.

To mitigate the issue

  • make sure that your application is using valid Firebase options from the latest google-services.json file from your Firebase console: Firebase options: instructions and background.
  • If you use API restrictions, make sure that the API key used by your application is white-listed for the Firebase Installations API (and for your application): API restrictions: instructions and background
  • Regarding Application restrictions: Either set the radio button to None or make sure that your app is white-listed (with the correct SHA-1 certificate).

For details, please visit:
https://firebase.google.com/support/privacy/init-options

like image 11
Andreas Rayo Kniep Avatar answered Oct 17 '22 18:10

Andreas Rayo Kniep


I had the same issue and in my case, my android emulator didn't have Google Play Services added. Created a new one with Google Play Services services and it worked.

like image 5
Philipos D. Avatar answered Oct 17 '22 18:10

Philipos D.


Instead of downgrading, enable Firebase Installation API to your firebase key from Firebase: 403 PERMISSION_DENIED (FirebaseError: Installations): Requests are blocked, after updating SDKs (FirebaseInstallationsService)

like image 2
purpatel Avatar answered Oct 17 '22 20:10

purpatel


Solution 1

  1. If you made any configuration changes in the firebase console - Redownload and update google-services.json file in the project.

Solution 2

  1. If You are using a Real device Check your Internet connection.

  2. If you are using android studio Emulator - Establish an internet connection by resetting the emulator.

    2.1. Open Tools -> AVD manager

Step 2.1

2.2. Wipe Data of the emulator Wipe Data of the emulator 2.2

  1. Run Project using fresh emulator.
like image 2
Ajith Ramesh Avatar answered Oct 17 '22 18:10

Ajith Ramesh