I'm getting following error on some devices while fetching firebase token:
Fatal Exception: d.b.a.b.g.f
java.io.IOException: AUTHENTICATION_FAILED
com.google.android.gms.tasks.zzu.getResult (zzu.java:15)
MainActivity$3.onComplete (MainActivity.java:387)
Caused by java.io.IOException
AUTHENTICATION_FAILED
com.google.firebase.iid.zzu.then (zzu.java:16)
com.google.android.gms.tasks.zzd.run (zzd.java:5)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
com.google.android.gms.common.util.concurrent.zza.run (zza.java:6)
java.lang.Thread.run (Thread.java:784)
Error log from Developer Console:
com.google.android.gms.tasks.RuntimeExecutionException:
at com.google.android.gms.tasks.zzu.getResult (zzu.java:15)
at com.example.MainActivity$3.onComplete (MainActivity.java:387)
at com.google.android.gms.tasks.zzj.run (zzj.java:4)
at android.os.Handler.handleCallback (Handler.java:808)
at android.os.Handler.dispatchMessage (Handler.java:101)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7529)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Caused by: java.io.IOException:
at com.google.firebase.iid.zzu.then (zzu.java:16)
at com.google.android.gms.tasks.zzd.run (zzd.java:5)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at com.google.android.gms.common.util.concurrent.zza.run (zza.java:6)
at java.lang.Thread.run (Thread.java:784)
Here is the code which is responsible to fetch firebase token:
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
@Override
public void onComplete(@NonNull Task<InstanceIdResult> task) {
if (task.getResult() != null && task.isSuccessful()) {
String firebaseToken = task.getResult().getToken();
}
}
});
I'm using following gradle dependencies.
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.0.1'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
I found similar questions and problems but no conclusive answer. Some suggest it may be result of broken internet connection but my app needs authenticate before entering the app so internet is available. Is there anybody encountered same issue? Best regards.