1

This is the code I have for trying to instantiate it:

gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .build();
    mGoogleApiClient = new GoogleApiClient.Builder(PSSignInFlowActivity.this)
            .enableAutoManage(this/* FragmentActivity */, new GoogleApiClient.OnConnectionFailedListener() {
                @Override
                public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

                }
            } /* OnConnectionFailedListener */)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .build();

This is what I have in my build.gradle:

 compile 'com.google.android.gms:play-services-maps:+'
compile 'com.google.android.gms:play-services-location:+'
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-auth:9.0.2'

I get this error:

07-19 11:23:47.668: E/AndroidRuntime(2275): FATAL EXCEPTION: main
07-19 11:23:47.668: E/AndroidRuntime(2275): Process: nl.hgrams.passenger, PID: 2275
07-19 11:23:47.668: E/AndroidRuntime(2275): java.lang.NoSuchMethodError: No virtual method zztw()Ljava/util/Set; in class Lcom/google/android/gms/common/internal/zzg; or its super classes (declaration of 'com.google.android.gms.common.internal.zzg' appears in /data/app/nl.hgrams.passenger-1/base.apk)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.auth.api.signin.internal.zzd.<init>(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.auth.api.Auth$4.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.auth.api.Auth$4.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.common.api.GoogleApiClient$Builder.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.common.api.GoogleApiClient$Builder.zzaof(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.google.android.gms.common.api.GoogleApiClient$Builder.build(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at nl.hgrams.passenger.activities.PSSignInFlowActivity.onCreate(PSSignInFlowActivity.java:75)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.Activity.performCreate(Activity.java:6251)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.ActivityThread.-wrap11(ActivityThread.java)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.os.Handler.dispatchMessage(Handler.java:102)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.os.Looper.loop(Looper.java:148)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at android.app.ActivityThread.main(ActivityThread.java:5417)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at java.lang.reflect.Method.invoke(Native Method)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
07-19 11:23:47.668: E/AndroidRuntime(2275):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
rosu alin
  • 5,674
  • 11
  • 69
  • 150

2 Answers2

3

See the similar issue,

Changing 'com.google.android.gms:play-services-auth:9.0.2' to

'com.google.android.gms:play-services-auth:9.2.0'

will work fine.

Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
  • I now get an Error like this as a response back: Status{statusCode=DEVELOPER_ERROR, resolution=null} Why Do I get an Developer_error back? – rosu alin Jul 19 '16 at 10:18
  • Refer [this](http://stackoverflow.com/a/37447381/5067493) For clear and brief explanation as well. – Shree Krishna Jul 19 '16 at 10:25
  • I entered here: https://developers.google.com/mobile/add?platform=android&cntapi=signin&cnturl=https:%2F%2Fdevelopers.google.com%2Fidentity%2Fsign-in%2Fandroid%2Fsign-in%3Fconfigured%3Dtrue&cntlbl=Continue%20Adding%20Sign-In And it created a new AndroidKey in my consoleDevelopers, Shouldn't it use my key instead? Now I have this: Android key (auto created by Google Service) Jul 19, 2016 And this: Android key 1 Jun 11, 2014 – rosu alin Jul 19 '16 at 10:38
  • or how can I take the configuration file from my old androidkey? – rosu alin Jul 19 '16 at 10:45
  • Was it necessary to generate new key ? To be frank I didn't focus on android since many months because of .NET project and a bit unfamiliar with firebase and others.. I'm really sorry bro.. It seems difficult to use old configuration with new key but may be possible...You may know about this better than me.. Hope you'll understand :) – Shree Krishna Jul 19 '16 at 10:53
  • +1'ed this. thanks. I did a new key, and I did manage to make it work. I'll just leave it like this for now. I tried to create the json config file with the old key but no luck, but this is good – rosu alin Jul 19 '16 at 10:56
1

Added compile 'com.google.android.gms:play-services-auth:+' instead of 9.0.2

rosu alin
  • 5,674
  • 11
  • 69
  • 150