'Error 10 in ionic native google plus login

I am using ionic native google plus login but I am getting error 10 after doing the same.

Below is my code :-

 doGoogleLogin(){
    this.googlePlus.login({})
      .then(res => {
        this.router.navigate(['./tabs']);
        this.userInfo = JSON.stringify(res);
        console.log(res);
      })
      .catch(err =>{
        console.log(err)
        this.userInfo = JSON.stringify(err);
      })
  }


Solution 1:[1]

After Searching 4 days i figured out you have to do simple steps do that carefully.

1 first check your ionic version

if it ionic 3

Install the Cordova and Ionic Native plugins:

 $ ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid
 $ npm install --save @ionic-native/google-plus@4

Add this plugin to your app's module

2.go to Google Cloude Console

Google Cloude Console

3.create Auth2

4.add your app id that com.xxxxxx.xxxxxx

Solution 2:[2]

I finally found a solution. I knew there was something to do with cordova not signing the APK with my ~/.android/debug.keystore file, so I created a debug-signing.properties file in the platforms/android folder and specified there the keystone path, password etc.

Things worked fine after that

Cheers !

debug-signing.properties file structure

keyAlias=yourkeyAlias

keyPassword=yourkeyPassword

storeFile=theFileContainingTheKeystore

storePassword=yourStorePassword

Solution 3:[3]

To get the solution I just run

keytool -exportcert -keystore ~/.android/debug.keystore -list -v

password: android

Copied SHA-1 and created a new OAuth2 with that hash

Visit: Github reply

Solution 4:[4]

I was using Android Client ID instead of Web Client Id. Once I changed it to webClientId, it worked.

Below is from google developer console, use the client ID from the web client in your Android app.

web client id

Solution 5:[5]

I think it's a little late to give the answer but still, it will help someone.

You may have not added your release JKS SHA-1 Key in your google cloud console.

just type the keytool command with your release jks path

keytool -list -v -keystore "path to jks file\keystore.jks" -alias release-1

enter image description here

you will get the SHA-1 from here now go to GC console and Create Credentials enter image description here

Now Select your application type and add SHA-1 in the place now Click on Create and it should work.

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 Chanaka Weerasinghe
Solution 2
Solution 3 Leonardo
Solution 4 coderpc
Solution 5 Preetam Jakhmola