I currently have a google subscription API working flawlessly through Android Studio Debugger, and when I install the APK on my Samsung S6. But when I try to debug the connection via USB, GoogleSignInResult.isSuccess () always returns false.
This is a little annoying because I need to debug another function that seems to work very well when debugging through Android studio, but not on my device, and I can't get past my login screen. -_-
Here is a block of code that fails, and I can provide more pieces of code if necessary.
private void handleSignInResult(GoogleSignInResult result) {
Log.d(TAG, "handleSignInResult:" + result.isSuccess());
if (result.isSuccess()) {
GoogleSignInAccount acct = result.getSignInAccount();
Intent myIntent = new Intent(getApplicationContext(), MainActivity.class);
myIntent.putExtra("account", acct);
startActivity(myIntent);
finish();
}
}
private void signIn() {
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
}
}
Thanks!
source
share