firebase-android-sdk: FirebaseException "unable to resolve host" should be a FirebaseNetworkException
Step 2: Describe your environment
- Android Studio version: Android Studio Arctic Fox | 2020.3.1 Canary 2
- Firebase Component: Auth
- Component version: 20.0.0
Step 3: Describe the problem
getIdToken is passing this FirebaseException
to the failure listener of getIdToken
. The message clearly indicates it’s a network issue, it would be better if the exception were a FirebaseNetworkException
(I auto-retry on FirebaseNetworkException
)
Steps to reproduce:
Not sure, I got this stacktrace report via Sentry.
Relevant Code:
com.google.firebase.FirebaseException: An internal error has occurred. [ Unable to resolve host "securetoken.googleapis.com":No address associated with hostname ]
at com.google.firebase.auth.api.internal.zzem.zza(com.google.firebase:firebase-auth@@20.0.0:18)
at com.google.firebase.auth.api.internal.zzfx.zza(com.google.firebase:firebase-auth@@20.0.0:21)
at com.google.firebase.auth.api.internal.zzfq.zza(com.google.firebase:firebase-auth@@20.0.0:35)
at com.google.firebase.auth.api.internal.zzfs.zza(com.google.firebase:firebase-auth@@20.0.0:74)
at com.google.firebase.auth.api.internal.zzel.zza(com.google.firebase:firebase-auth@@20.0.0:61)
at com.google.firebase.auth.api.internal.zzc.zza(com.google.firebase:firebase-auth@@20.0.0:3)
at com.google.firebase.auth.api.internal.zzgb.zza(com.google.firebase:firebase-auth@@20.0.0:37)
at com.google.firebase.auth.api.internal.zzfn.zza(com.google.firebase:firebase-auth@@20.0.0:41)
at com.google.firebase.auth.api.internal.zza.zza(com.google.firebase:firebase-auth@@20.0.0:8)
at com.google.firebase.auth.api.internal.zzep.zza(com.google.firebase:firebase-auth@@20.0.0:76)
at com.google.firebase.auth.api.internal.zzbr.zza(com.google.firebase:firebase-auth@@20.0.0:24)
at com.google.firebase.auth.api.internal.zzbq.accept(Unknown Source:6)
at com.google.android.gms.common.api.internal.zacj.doExecute(com.google.android.gms:play-services-base@@17.1.0:2)
at com.google.android.gms.common.api.internal.zaf.zac(com.google.android.gms:play-services-base@@17.1.0:6)
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zac(com.google.android.gms:play-services-base@@17.1.0:167)
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zab(com.google.android.gms:play-services-base@@17.1.0:139)
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabg(com.google.android.gms:play-services-base@@17.1.0:99)
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabe(com.google.android.gms:play-services-base@@17.1.0:40)
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnected(com.google.android.gms:play-services-base@@17.1.0:19)
at com.google.android.gms.common.internal.zaf.onConnected(com.google.android.gms:play-services-base@@17.1.0:2)
at com.google.android.gms.common.internal.BaseGmsClient$zzg.zzj(com.google.android.gms:play-services-basement@@17.1.1:24)
at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(com.google.android.gms:play-services-basement@@17.1.1:12)
at com.google.android.gms.common.internal.BaseGmsClient$zzb.zzo(com.google.android.gms:play-services-basement@@17.1.1:11)
at com.google.android.gms.common.internal.BaseGmsClient$zzc.handleMessage(com.google.android.gms:play-services-basement@@17.1.1:49)
at android.os.Handler.dispatchMessage(Handler.java:107)
at com.google.android.gms.internal.common.zzi.dispatchMessage(com.google.android.gms:play-services-basement@@17.1.1:8)
at android.os.Looper.loop(Looper.java:237)
at android.os.HandlerThread.run(HandlerThread.java:67)
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 6
- Comments: 23 (9 by maintainers)
I’ve filed b/176825910 to track work on this internally - you’re right, this should be a network exception. I’m hoping that this will be a quick fix 😃
Hey there, I use anonym auth for all clients and I get a lot of App crashes: I’m on ‘com.google.firebase:firebase-auth:20.0.4’ but had that already in prev. releases as well. I need a valid token to communicate with my own backend, therefore all clients are at least anonymous logged in and authtoken is refreshed if outdated. My Crashfree rate dropped by about 0.5% because if this FibreaseNetworkExceptions that can’t be catched.
I don’t know what do do, tried already to only call it if the client has internet connection but still happens. I can’t understand why you send out an Exception that can be catched on something like an Internet connection on a Mobile SDK, seems to me like a totally wrong decission.
Fatal Exception: com.google.firebase.FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred. at com.google.android.gms.internal.firebase-auth-api.zztt.zza(zztt.java:17) at com.google.android.gms.internal.firebase-auth-api.zzvb.zza(zzvb.java:9) at com.google.android.gms.internal.firebase-auth-api.zzvc.zzk(zzvc.java:1) at com.google.android.gms.internal.firebase-auth-api.zzuz.zzh(zzuz.java:25) at com.google.android.gms.internal.firebase-auth-api.zztq.zzk(zztq.java:1) at com.google.android.gms.internal.firebase-auth-api.zzpm.zza(zzpm.java:2) at com.google.android.gms.internal.firebase-auth-api.zzpl.zza(zzpl.java:1) at com.google.android.gms.internal.firebase-auth-api.zzvg.zza(zzvg.java:27) at com.google.android.gms.internal.firebase-auth-api.zzuq.zzh(zzuq.java:4) at com.google.android.gms.internal.firebase-auth-api.zzpm.zzb(zzpm.java:4) at com.google.android.gms.internal.firebase-auth-api.zzpy.zzM(zzpy.java:5) at com.google.android.gms.internal.firebase-auth-api.zzpy.zzD(zzpy.java:3) at com.google.android.gms.internal.firebase-auth-api.zztu.zzo(zztu.java:5) at com.google.android.gms.internal.firebase-auth-api.zzrv.accept(zzrv.java:4) at com.google.android.gms.common.api.internal.zacr.doExecute(zacr.java:1) at com.google.android.gms.common.api.internal.zag.zaf(zag.java:1) at com.google.android.gms.common.api.internal.zabl.zaG(zabl.java:2) at com.google.android.gms.common.api.internal.zabl.zaF(zabl.java:5) at com.google.android.gms.common.api.internal.zabl.zad(zabl.java:3) at com.google.android.gms.common.api.internal.GoogleApiManager.handleMessage(GoogleApiManager.java:64) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:164) at android.os.HandlerThread.run(HandlerThread.java:65)
@mikehardy disabled the bot for this thread 😃
We are still getting this in
firestore-auth 20.0.3
com.google.firebase.FirebaseException: An internal error has occurred. [ Failed to connect to securetoken.googleapis.com/216.58.213.170:443 ]
Same happens in Airplane mode (not my link) https://stackoverflow.com/questions/57780604/firebase-throwing-firebaseexception-instead-of-firebasenetworkexception-when-the Support is trying to convince me that this is ok 👎