Ionic Native Google Plus not working on Android

I’m trying to login using Google.
I’m using the Google Plus native plugin


However when I call the

     this.googlePlus.login({
      'scopes':  'profile email', 
      'webClientId': 'xxxx.apps.googleusercontent.com'
      'offline':  false    
    }).then(res => {
      console.log('Google Response: ',res);
    }).catch(err => {
      console.log('Google Error: ',err);
    });    

I got nothing, not even an error message,

What is wrong?

Thanks

Ps.: I have already checked my client ID and reversed client ID.

I found the solution for this problem on this post .
I’m using android platform 6.4.0. I did not test it on a newer version, and I had to remove the platform and add it again and to build it before run.

Did you add the same Android 6.4.0 or did you have to add an older version?

I have the same problem and this solution did not solve for me.

My project.properties

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.38.1
cordova.gradle.include.1=cordova-plugin-firebase/easychurch-build.gradle
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.3=com.google.firebase:firebase-core:+
cordova.system.library.4=com.google.firebase:firebase-messaging:+
cordova.system.library.5=com.google.firebase:firebase-config:+
cordova.system.library.6=com.google.firebase:firebase-perf:+
cordova.system.library.7=com.android.support:support-annotations:27.+
cordova.system.library.8=com.google.android.gms:play-services-auth:11.8.0
cordova.system.library.9=com.google.android.gms:play-services-identity:11.8.0

My login code:

this.googlePlus.login({
          'scopes': '',
          'webClientId': 'webclientId',
          'offline': true,
          })
          .then(user => {
            console.log('User', user);
          }, err => {
            console.log(err);
            if (!this._platform.is('cordova')) {
              this.presentAlert();
            }
            loading.dismiss();
          });

He just does not do anything. Not an error message.
Can someone help me?

Ps: my WebClientId is all in line with the Firebase project and the Google Console.

Hi! I have the same issue with the latest version of android platform. I tried with previous versions of android (6.4.0) and i only got the “12500” Error. I have installed everything again with the latest versions and i only get an empty error. I hope someone can help me. I’ve been working on this all week and at this point I’m a bit frustrated.

Ionic:

ionic (Ionic CLI) : 4.3.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 8 other plugins)

System:

NodeJS : v10.13.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS
Xcode : Xcode 10.1 Build version 10B61

This is my code:

      this.googlePlus.login({
        'webClientId': 'id.apps.googleusercontent.com',
        'offline': true
      })
      .then( r => {
        console.log('respuesta login => '+ JSON.stringify(r));
      })
      .catch( e => {
        console.log('error del metodo login => '+ JSON.stringify(e) );
      });

Thanks for your time and sorry for my bad english.

I fixed this with this.
First

Downgrade cordova-plugin-googleplus to ^5.2.1,

ionic cordova plugin remove cordova-plugin-googleplus
npm uninstall --save @ionic-native/google-plus
Second
cordova plugin add cordova-plugin-googleplus@5.2.1 --variable REVERSED_CLIENT_ID=YOUR_CLIENT_ID
npm install @ionic-native/google-plus

6 Likes

Yup, downgrading worked for me also :+1:

1 Like

thanks.it worked…

Thanks, this save my day.