Ionic 2 Firebase Google Login 12501 Error

Whenever I select my account the popup closes and I get the 12501 error.
This is my code:

      console.log("Response: "+res);
      console.log("Error: "+err);

I used the Web client ID.

I implemented a Facebook login and it is working, but I cannot get google sign-in to work.
I added the sha-1 key into my firebase project.

When I am trying to login on my browser (with ionic serve) without the GooglePlus plugin it works. This is the code:

var provider = new firebase.auth.GoogleAuthProvider();


How can I fix this error?
Thank you for your help!

I’m having the same error in Android!

I created the provider differently:

var provider = firebase.auth.GoogleAuthProvider.credential(res.idToken);

where I am taking the response from the ionic native plugin’s callback. This was for Android, iOS was:

var provider = firebase.auth.GoogleAuthProvider.credential(res.id_token, res.accessToken);

with Android you may have “offline” set to true passed in with the webClientId, everything should work so long as the webClientId and SHA were defined correctly.

Could you post the code for the android app please?

Does my android phone have an own sha?

Hey, I wrote a tutorial about it a couple of days ago, you can find it here.

Basically you need to go through the entire google flow and then pass the credential to Firebase, with .signInWithCredential() you can’t use the pop-up methods in your phone through Ionic.

For the SHA-1 of the keystore fingerprint, you need 2, one for development and one for production, the article goes over it a bit more in-depth.

1 Like

Thank you for the link, but unfortunately it is not working. I am still getting the 12501 error.

Has anyone found a solution to the 12501 error?

From what I have read it is related to the Android keystore (e.g. debug.keystore) not matching the one in your Google API Credentials. However, mine are matching and I still get the error.

I just met with this issue and its’ all about your SHA1 mis match … The best I did is to delete the key and generate a new one again… But this time, when you pick OAuth , try to pick it for Android and generate the key. It should work now… This is applicable when you have Google Plus ionic-native plugin running to support the native functions of Google Plus login with an account pop up. Hope this answer helps someone !

Cheers !
Happy Coding !

Hi, do you delete the debug key or release key? if you delete the debug key how do you that? And how tell to the app that the new debug release key is the new that you has created