[FIXED] Plugin_not_installed error on Android when using cordova-plugin-googleplus


#1

Hi all, I followed this tutorial to install googleplus login natively:
https://javebratt.com/ionic-google-login/

After many hours of debugging, I finally got it to load the app on Android, but when I click on the “Google Login”, I get the following error:
plugin_not_installed

The error is thrown from this code:

    if (this.platform.is('cordova')) {
      try {

        const googleLogin = await this.googlePlus.login({
          webClientId: "XXXXX",
          offline: true,
        });

        const credential: AuthCredential = firebase.auth.GoogleAuthProvider.credential(googleLogin.idToken);

        const user: User = await this.afAuth.auth.signInWithCredential(credential);

        return user;

      } catch (error) {
        console.error(error);
      }

Any help would be greatly appreciated. I’m stumped right now :thinking:
Thanks!

This is my environment:

cli packages: (/.nvm/versions/node/v8.11.1/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 7.0.0 browser 5.0.3 ios 4.1.1
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.0
ios-sim           : 5.0.11
Node              : v8.11.1
npm               : 6.0.0
OS                : macOS Sierra
Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : XXX/Library/Android/sdk

Misc:

backend : pro
$ cordova plugin ls
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-plugin-add-swift-support 1.7.1 "AddSwiftSupport"
cordova-plugin-crosswalk-webview 2.2.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.3 "Device"
cordova-plugin-googleplus 5.3.0 "Google SignIn"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic 2.0.4 "IonicCordova"
cordova-plugin-splashscreen 4.0.0 "Splashscreen"
cordova-plugin-statusbar 2.2.0 "StatusBar"
cordova-plugin-whitelist 1.3.0 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

#2

I was able to fix it by removing and then re-installing the cordova and ionic native plugin!