Obviously, first check that your sha1 key is correct for release. But the problem here was different. I am using new google play services (iecompile 'com.google.android.gms: play-services: 8.4.0'). And the problem can be solved by changing the GoogleSignInOption object. Instead:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .requestIdToken("YOUR_WEB_API_ID.apps.googleusercontent.com") .build();
I use:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(new Scope(Scopes.PLUS_LOGIN)) .requestScopes(new Scope(Scopes.PLUS_ME)) .requestEmail() .build();
This solves the error returning statusCode = INTERNAL_ERROR. You can then use this gso object to create a GoogleApiClient, as shown below:
mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this, this) .addApi(Auth.GOOGLE_SIGN_IN_API,gso) // .addApi(Plus.API, null) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) // .addScope(Plus.SCOPE_PLUS_LOGIN) .build();
silwalprabin Apr 12 '16 at 14:13 2016-04-12 14:13
source share