Skip to content

Android Firebase Auth signInWithCustomToken fails only in production app #2032

@coolcool1994

Description

@coolcool1994

I am using: implementation 'com.google.firebase:firebase-auth-ktx:19.3.2'

I have a production app, and signInWithCustomToken is failing every single time. Task here is always unsuccessful in the production app. Firebase.auth.signInWithCustomToken(custom_token).addOnCompleteListener(activity){ task ->

I was so alarmed so I just ran the app from Android Studio in debug build, and signInWithCustomToken is successful every time.

I reinstall the production, and signInWithCustomToken fails every time.

Why does Firebase.auth.signInWithCustomToken fail in the production app every time when the debug app from Android Studio is successful every time? In iOS, everything works in both production and in debug. Just in Android it's the problem. And In production, it used to work before a few days ago (the same app). I attach logcat of the release build (production) app

2020-10-01 22:27:47.910 2450-2475/? 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.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@20.2.3:55)
        at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@20.2.3:37)
        at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@20.2.3:13)
        at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(com.google.firebase:firebase-iid@@20.2.3:164)
        at com.google.firebase.iid.FirebaseInstanceId$$Lambda$4.start(Unknown Source:8)
        at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@20.2.3:14)
        at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$3$FirebaseInstanceId(com.google.firebase:firebase-iid@@20.2.3:163)
        at com.google.firebase.iid.FirebaseInstanceId$$Lambda$1.then(Unknown Source:6)
        at com.google.android.gms.tasks.zzf.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: com.google.firebase.installations.FirebaseInstallationsException
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:382)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:350)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        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:919) 
2020-10-01 22:27:47.958 2450-2509/? E/Firebase-Installations: Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase.
2020-10-01 22:27:47.975 2450-2478/? E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: FIS_AUTH_ERROR. Won't retry the operation.```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions