'Error 10 in Google Login plugin for Ionic/Angular/Cordova

I'm quite new to all that technologies, but trying to develop an android app with Ionic 6 and Angular 9, compiling with Cordova and publishing in Google Play. Evereything works fine except that I can't solve the ERROR 10 that I get when I try to login with google. The app in Google Play: Chefpapers.

I browsed similar questions, allways say its about SHA1 not registered, or package name, I checked that things, but never find the solution.

My code:

this.googlePlus.login({}).then(... doing something ...)
  .catch(err => this.errorMessage = "Error " + JSON.stringify(err));

Things I did:

  1. Setup a Firebase project as per doc.
  2. Set the SHA1 in the Android key for the key I used to sign the APK in release, as per doc.
  3. I also checked with webId parameter in the login function, same result.
  4. Set the package name in the config.xml and the firebase app are exactly the same. I also tried to remove the project and create a new one.
  5. Checked the credentials in the API services console.

It works well with broswer, but not in Android. Thanks for help! Quimi



Solution 1:[1]

Finally after 10 days of doing a lot of tests I solved it, and it's a solution I didn't found in any other post:

  1. In google play console, I was using my own certificate to sign the app.
  2. I asked google to change the certificate and let google sign with it's own created file.
  3. So I just need to sign the APK before uploading with my certificate which is the one used for loading now, and then Google sign the app when somebody is using with another key.
  4. I pasted the new public key of that google certificate in the Credentials API service and voilĂ !

Solution 2:[2]

My connection from Google worked in debug mode but not once in the PlayStore.

I finally found the solution a bit aleatory so I hope people save time doing this:

Go to your console.cloud.google.com and select your android project enter image description here

Change the SHA-1 certificate by the one you can find on the app page of your play.google.com/console/u/0/developers/YOUR_APP enter image description here

The SHA-1 looks like that: 0A:1A:22:5O:6A:55:48:77:50:21:XB:5F:27:BF:1D:41:XX:0P:99:LP

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Quimi Font
Solution 2 Selorb