1
votes

I'm getting exception as

com.google.firebase.remoteconfig.FirebaseRemoteConfigClientException: Firebase Installations failed to get installation auth token for fetch.

Can anyone tell me what's wrong with my code? I've initialised remote config like this

val firebaseRemoteConfig: FirebaseRemoteConfig by lazy { FirebaseRemoteConfig.getInstance() }

val firebaseRemoteConfigSettings = FirebaseRemoteConfigSettings.Builder()
        .setMinimumFetchIntervalInSeconds(0)
        .build()
firebaseRemoteConfig.setConfigSettingsAsync(firebaseRemoteConfigSettings)
    firebaseRemoteConfig.setDefaultsAsync(configDefault)
 if (NetworkConnectionHelper().connectionStatus(context)) {
        firebaseRemoteConfig.fetchAndActivate()
                .addOnCompleteListener { task: Task<Boolean?> ->
                    if (task.isSuccessful) {
                        setup()
                        Utils.log("remoteConfig Success.")

                    } else {
                        Utils.log("remoteConfig failed.")
                        setup()
                    }

                }
                .addOnFailureListener { exception -> Utils.log("remoteConfig exception: $exception") }
                .addOnCanceledListener { Utils.log("remoteConfig initAssetList: cancelled ") }
    } else {
        setup()
    }

What I've tried so far

  1. I've added SHA1 Key to Google Api & services, under "Restrict usage to your Android apps" section
  2. Uninstall and install the app.
  3. Added SHA1 key in firebase console.
  4. tried with only "fetch()" method of remoteconfig instead of fetchAndActivie().

but nothing help, I'm unable to fetch values from remote config.

1
please post full error logPriyanka
@Priyankagb I'm not getting error, I'm getting exception and I've printed exception in log, I've updated my question with exception message.syed dastagir

1 Answers

0
votes

Finally after spending whole day I found the mistake, it was my spell mistake in package name while adding SHA-1 in Google's api & services portal. Thanks anyway.