Error: Google id_token is not allowed to be used with this application. Firebase access fails after it was working
<p>I'm using Google SignIn and then authenticate on Firebase using <code>signInWithCredential</code>, passing the Google credentials.</p>

<p>I followed all the procedures, and everything was working! And suddenly it stops working. I went to a previous working code and it still fails. So it seems something happened with the database configuration.</p>

<p>In Firebase DB I already checked:</p>

<ul>
<li>DB is up and running. As a fact I can read when not logged (as I have defined by rules)</li>
<li>Sign-in method for Google is still ENABLED</li>
<li>My App is still registered the project configuration, including their SHA1 signature (for debug and release version)</li>
<li>I have confirmed the google-services.json file downloaded from configuration still match my app json file</li>
</ul>

<p>After Google login finish Ok, the error message is as follows as I get from my try-catch with task.getException in the listener:</p>

<pre><code>com.google.firebase.FirebaseException: An internal error has occurred. [ Invalid Idp Response: the Google id_token is not allowed to be used with this application. Its audience (OAuth 2.0 client ID) is XXXXX-XXXXX.apps.googleusercontent.com, which is not authorized to be used in the project with project_number: XXXXX. ]
     at com.google.android.gms.internal.zzago.zzew(Unknown Source)
     at com.google.android.gms.internal.zzagl$zzg.zza(Unknown Source)
     at com.google.android.gms.internal.zzagw.zzex(Unknown Source)
     at com.google.android.gms.internal.zzagw$zza.onFailure(Unknown Source)
     at com.google.android.gms.internal.zzagr$zza.onTransact(Unknown Source)
     at android.os.Binder.execTransact(Binder.java:453)
</code></pre>

<p>(I changed my project info to XXXX)</p>

<p>What else could have changed in the Firebase configuration? Please help!</p>

<p><strong>Edit: SOLVED</strong>, as described below. You need to also take a look at the Google API console at <a href="https://console.developers.google.com/apis/credentials" rel="noreferrer">https://console.developers.google.com/apis/credentials</a></p>