question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API key not valid

See original GitHub issue

I’m learning firebase through Firebase Android Codelab - Build Friendly Chat I’ve done all coding according to instruction till the end of Enable Authentication section. But when trying to test the app I encounter with the following message: 2021-11-13 09:42:17.083 4741-4741/? E/AuthUI: A sign-in error occurred. com.google.firebase.FirebaseException: An internal error has occurred. [ API key not valid. Please pass a valid API key. ] at com.google.android.gms.internal.firebase-auth-api.zzto.zza(com.google.firebase:firebase-auth@@21.0.1:4) at com.google.android.gms.internal.firebase-auth-api.zzuw.zza(com.google.firebase:firebase-auth@@21.0.1:9) at com.google.android.gms.internal.firebase-auth-api.zzux.zzl(com.google.firebase:firebase-auth@@21.0.1:1) at com.google.android.gms.internal.firebase-auth-api.zzuu.zzk(com.google.firebase:firebase-auth@@21.0.1:25) at com.google.android.gms.internal.firebase-auth-api.zztl.zzh(com.google.firebase:firebase-auth@@21.0.1:1) at com.google.android.gms.internal.firebase-auth-api.zzoj.zza(com.google.firebase:firebase-auth@@21.0.1:2) at com.google.android.gms.internal.firebase-auth-api.zzvb.zza(com.google.firebase:firebase-auth@@21.0.1:23) at com.google.android.gms.internal.firebase-auth-api.zzul.zza(com.google.firebase:firebase-auth@@21.0.1:4) at com.google.android.gms.internal.firebase-auth-api.zzpt.zzq(com.google.firebase:firebase-auth@@21.0.1:4) at com.google.android.gms.internal.firebase-auth-api.zztp.zzl(com.google.firebase:firebase-auth@@21.0.1:5) at com.google.android.gms.internal.firebase-auth-api.zzql.zzd(com.google.firebase:firebase-auth@@21.0.1:3) at com.google.android.gms.internal.firebase-auth-api.zzqk.accept(Unknown Source:6) at com.google.android.gms.common.api.internal.zacj.doExecute(com.google.android.gms:play-services-base@@17.5.0:2) at com.google.android.gms.common.api.internal.zah.zaa(com.google.android.gms:play-services-base@@17.5.0:9) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zac(com.google.android.gms:play-services-base@@17.5.0:193) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zab(com.google.android.gms:play-services-base@@17.5.0:158) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa(com.google.android.gms:play-services-base@@17.5.0:126) at com.google.android.gms.common.api.internal.GoogleApiManager.handleMessage(com.google.android.gms:play-services-base@@17.5.0:164) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:67) It seems the the API key given in mock-google-services.json has expired. What’s the solution for this issue?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
mdsadiqueinamcommented, Nov 17, 2021

Found the solution, the issue is occurring because if (BuildConfig.DEBUG) { FirebaseDatabase.getInstance().useEmulator("10.0.2.2", 9000) FirebaseAuth.getInstance().useEmulator("10.0.2.2", 9099); FirebaseStorage.getInstance().useEmulator("10.0.2.2", 9199) } here BuildConfig.DEBUG is giving false when app build, that why the emulator is not connection with app, make sure BuildConfig is imported from Build generated file

1reaction
nishatomacommented, Jan 13, 2022

Was anyone able to resolve this issue?

Update: I was using the wrong BuildConfig class, I deleted some BuildConfig Import, and it ended up using the local BuildConfig class from the project, which is the correct file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Key not valid error when trying to access Google cloud ...
For the "API key not valid" issue, it appears that you are using a Server key, but you need to use a browser...
Read more >
Error: Your Google API Key is not valid for this request and ...
I have my domain verified. I have an API and a place ID but I still get the error: Error: Your Google API...
Read more >
Error Messages | Maps JavaScript API - Google Developers
Check errors in your browser. If you see the following messages, you are not using your API key correctly:
Read more >
Civic Cookie Control: Sorry, this api key is not valid. Please ...
No, Cookie Control's apikey works like a Google or a Facebook apikey and is bound to a specific domain. You cannot use it...
Read more >
{"code":"IA-0002","error":"API key '' is not valid
This can be confirmed by checking for the scoped keys via GET /analytics/api/v1/apikeys and confirming the API key listed in the error is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found