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

java.lang.NoClassDefFoundError: com.google.android.gms.auth.api.Auth #488

Open jullicer opened 6 years ago

jullicer commented 6 years ago

GooglePlugin: Building Google options04-26 16:32:44.984 17593 17690 I GooglePlugin: Building GoogleApiClient 04-26 16:32:44.984 17593 17690 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google. android.gms.auth.api.Auth>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/and roid/gms/common/ap i/Api$zzf;04-26 16:32:44.984 17593 17690 I art : (Throwable with no stack trace)Caused by: java.lang.Cl assNotFoundExcepti on: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file"/data/app/co.just ababy.app-1/base.apk"],nativeLibraryDirectories=[/data/app/co.justababy.app-1/lib/x86, /system/lib, /vendor/lib]] 04-26 16:32:44.984 17593 17690 I art : (Throwable with no stack trace) 04-26 16:32:44.984 17593 17690 W System.err: java.lang.NoClassDefFoundError: com.google.android.gms.auth.api.Auth ...

jullicer commented 6 years ago

i fix the issue by setting all com.google.android.gms:play-* to +

Zvika88 commented 6 years ago

Yes, that does it !

gbarrionuevo commented 6 years ago

doesn't works for me, any other idea?

javierUDP commented 6 years ago

doesn't works for me too

heeeeellppppp

thiani commented 6 years ago

Anyone who got the solution?

ccorcos commented 6 years ago

@jullicer what does that mean?

rlzh commented 6 years ago

@ccorcos I think it's like this? Instead of
<framework src="com.google.android.gms:play-services-auth:11.8.0" />

you change it to <framework src="com.google.android.gms:play-services-auth:+" />

It didn't work for me when I tried it though...

jullicer commented 6 years ago

this is my project properties but dunno it just fix the issue on google plus login and in app purchase

target=android-26 android.library.reference.1=CordovaLib cordova.gradle.include.1=com-sarriaroman-photoviewer/app-photoviewer.gradle cordova.gradle.include.2=cordova-fabric-plugin/app-build-extras.gradle cordova.gradle.include.3=cordova-plugin-badge/app-badge.gradle cordova.system.library.1=com.android.support:support-v4:24.1.1+ cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.+ cordova.gradle.include.4=cordova-plugin-firebase/app-build.gradle cordova.system.library.3=com.google.gms:google-services:+ cordova.system.library.4=com.google.android.gms:play-services-tagmanager:+ cordova.system.library.5=com.google.firebase:firebase-core:+ cordova.system.library.6=com.google.firebase:firebase-messaging:+ cordova.system.library.7=com.google.firebase:firebase-crash:+ cordova.system.library.8=com.google.firebase:firebase-config:+ cordova.system.library.9=com.google.firebase:firebase-perf:+ cordova.system.library.10=com.google.android.gms:play-services-analytics:+ cordova.system.library.11=com.google.android.gms:play-services-auth:+ cordova.system.library.12=com.google.android.gms:play-services-identity:+ cordova.gradle.include.5=cordova-plugin-intercom/app-intercom.gradle cordova.gradle.include.6=cordova-plugin-intercom/app-build-extras-intercom.gradle cordova.system.library.13=com.google.android.gms:play-services-location:+ cordova.system.library.14=com.google.android.gms:play-services-location:+ cordova.system.library.15=com.android.support:support-v4:24.1.1+ cordova.system.library.16=com.android.support:support-v4:26.+ cordova.system.library.17=com.android.support:appcompat-v7:26.+

ccorcos commented 6 years ago

FYI, adding this to my config.xml solved my issue:

        <plugin name="cordova-android-firebase-gradle-release" spec="1.0.2">
            <variable name="FIREBASE_VERSION" value="11.8.0" />
        </plugin>
        <plugin name="cordova-android-play-services-gradle-release" spec="1.4.3">
            <variable name="PLAY_SERVICES_VERSION" value="11.8.0" />
        </plugin>

The issue seems to be due to a conflict between these two packages.

        <plugin name="cordova-plugin-firebase" spec="0.1.22" />
        <plugin name="cordova-plugin-googleplus" spec="5.3.0">
            <!-- We need the web client is to get the server token for google contacts. -->
            <variable name="WEB_APPLICATION_CLIENT_ID" value="{{ googleOAuth.clientId }}"/>
            <variable name="REVERSED_CLIENT_ID" value="ignore"/>
        </plugin>
dalepo commented 6 years ago

I think PLAY_SERVICES_VERSION needs to be updated maybe? I don't think the class GooglePlus that extends GoogleApiClient will ever work if the version is 11.8.0. On line 182

buildGoogleApiClient(.........

        GoogleApiClient.Builder builder = new GoogleApiClient.Builder(webView.getContext())
            .addOnConnectionFailedListener(this)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso.build());

Auth class does not exists.

yiperu commented 5 years ago

Make the dependecies in you gradle same the same version