EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
566 stars 625 forks source link

Google plus login not working due to missing JAVA class #580

Open y-nut opened 5 years ago

y-nut commented 5 years ago
02-19 11:28:52.277 25608 25764 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.auth.api.zza>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zza;
02-19 11:28:52.277 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.277 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.277 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.277 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.277 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.277 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.277 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.277 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.277 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.277 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.277 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.277 25608 25764 I zygote  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zza" on path: DexPathList[[zip file "/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/lib/arm, /data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
02-19 11:28:52.277 25608 25764 I zygote  :   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
02-19 11:28:52.277 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
02-19 11:28:52.277 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
02-19 11:28:52.277 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.277 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.277 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.278 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.278 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.278 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.278 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.278 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.278 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.278 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.278 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.278 25608 25764 I zygote  : 
02-19 11:28:52.279 25608 25764 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.auth.api.zza>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zza;
02-19 11:28:52.279 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.279 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.279 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.279 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.279 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.279 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.280 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.280 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.280 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.280 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.280 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.280 25608 25764 I zygote  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zza" on path: DexPathList[[zip file "/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/lib/arm, /data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
02-19 11:28:52.280 25608 25764 I zygote  :   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
02-19 11:28:52.281 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.281 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.281 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.281 25608 25764 I zygote  : 
02-19 11:28:52.281 25608 25764 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.auth.api.zza>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zza;
02-19 11:28:52.281 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.281 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.281 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.281 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.281 25608 25764 I zygote  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zza" on path: DexPathList[[zip file "/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/lib/arm, /data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
02-19 11:28:52.281 25608 25764 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
02-19 11:28:52.281 25608 25764 I zygote  :   at void nl.xservices.plugins.GooglePlus.buildGoogleApiClient(org.json.JSONObject) (GooglePlus.java:181)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean nl.xservices.plugins.GooglePlus.execute(java.lang.String, org.apache.cordova.CordovaArgs, org.apache.cordova.CallbackContext) (GooglePlus.java:88)
02-19 11:28:52.281 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, org.json.JSONArray, org.apache.cordova.CallbackContext) (CordovaPlugin.java:117)
02-19 11:28:52.282 25608 25764 I zygote  :   at boolean org.apache.cordova.CordovaPlugin.execute(java.lang.String, java.lang.String, org.apache.cordova.CallbackContext) (CordovaPlugin.java:98)
02-19 11:28:52.282 25608 25764 I zygote  :   at void org.apache.cordova.PluginManager.exec(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (PluginManager.java:132)
02-19 11:28:52.282 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.CordovaBridge.jsExec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (CordovaBridge.java:59)
02-19 11:28:52.282 25608 25764 I zygote  :   at java.lang.String org.apache.cordova.engine.SystemExposedJsApi.exec(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (SystemExposedJsApi.java:41)
02-19 11:28:52.282 25608 25764 I zygote  :   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
02-19 11:28:52.282 25608 25764 I zygote  :   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:325)
02-19 11:28:52.282 25608 25764 I zygote  :   at void android.os.Looper.loop() (Looper.java:142)
02-19 11:28:52.282 25608 25764 I zygote  :   at void android.os.HandlerThread.run() (HandlerThread.java:65)
02-19 11:28:52.282 25608 25764 I zygote  : 
02-19 11:28:52.284 25608 25764 W System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
02-19 11:28:52.287 25608 25764 W System.err:    at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source:0)
02-19 11:28:52.287 25608 25764 W System.err:    at nl.xservices.plugins.GooglePlus.buildGoogleApiClient(GooglePlus.java:181)
02-19 11:28:52.287 25608 25764 W System.err:    at nl.xservices.plugins.GooglePlus.execute(GooglePlus.java:88)
02-19 11:28:52.287 25608 25764 W System.err:    at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:117)
02-19 11:28:52.287 25608 25764 W System.err:    at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
02-19 11:28:52.287 25608 25764 W System.err:    at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
02-19 11:28:52.288 25608 25764 W System.err:    at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
02-19 11:28:52.288 25608 25764 W System.err:    at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
02-19 11:28:52.288 25608 25764 W System.err:    at android.os.MessageQueue.nativePollOnce(Native Method)
02-19 11:28:52.293 25608 25764 W System.err:    at android.os.MessageQueue.next(MessageQueue.java:325)
02-19 11:28:52.299 25608 25764 W System.err:    at android.os.Looper.loop(Looper.java:142)
02-19 11:28:52.299 25608 25764 W System.err:    at android.os.HandlerThread.run(HandlerThread.java:65)
02-19 11:28:52.301 25608 25764 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file "/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/lib/arm, /data/app/com.birdi.market-OhNDSjF2ywUCU0lI39-IGQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
02-19 11:28:52.301 25608 25764 W System.err:    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
02-19 11:28:52.302 25608 25764 W System.err:    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
02-19 11:28:52.302 25608 25764 W System.err:    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
02-19 11:28:52.302 25608 25764 W System.err:    ... 12 more
lakshya-8 commented 5 years ago

This could be related to Google shutting down GooglePlus,

Google+ APIs will be shut down on March 7, 2019. This includes Google+ Sign-in and OAuth token requests with Google+ scopes. Learn more.
Google+ integrations for web and mobile apps will also cease to function March 7, 2019. Learn more.

This will be a progressive shutdown, with intermittent failures starting as early as January 28, 2019.

https://developers.google.com/+/mobile/android/api-deprecation

marcus13371337 commented 5 years ago

Having the same issue. Can I use Google SignIn and skip everything with GooglePlus?

marcus13371337 commented 5 years ago

Fixed by the following in build.gradle (app): compile "com.google.android.gms:play-services-auth:+" compile "com.google.android.gms:play-services-identity:+"

And build.gradle (android): classpath 'com.google.gms:google-services:4.2.0'

svzi commented 5 years ago

@marcus13371337 Could you please offer some insights about the gradle-file structure? Where exactly did you add those lines?

moranil commented 5 years ago

This happened when I upgraded to cordova-android8.0.0 and cordova9.0.0 Was able to resolve most of the build issues but google login was not working.

Updating in project.properties worked for me. Here are my updated file content

platforms/android/build.gradle

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' } // Fabrics Maven repository from cordova-plugin-firebase
    }

    dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.android.tools.build:gradle:3.3.0'

        classpath 'com.google.gms:google-services:4.2.0' // google-services dependency from cordova-plugin-firebase

        classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from cordova-plugin-firebase
    }
}

platforms/android/project.properties

# Project target.
target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-firebase/ichampapp-build.gradle
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.37.0
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.google.android.gms:play-services-auth:+
cordova.system.library.8=com.google.android.gms:play-services-identity:+
cordova.system.library.9=androidx.annotation:annotation:1.0.0
cordova.system.library.10=androidx.legacy:legacy-support-v4:1.0.0
cordova.system.library.11=androidx.legacy:legacy-support-v4:1.0.0
cordova.system.library.12=androidx.appcompat:appcompat:1.0.0

exception got resolved, but google login still not working

WilsonFpz commented 5 years ago

same issue here

lim-enhui commented 5 years ago

android > app > capacitor.build.gradle
implementation "com.google.android.gms:play-services-auth:16.0.1" implementation "com.google.android.gms:play-services-identity:16.0.0"