I've been facing some issues while integrating Google+ Signin functionality. So far, i've integrated all the necessary G+ Sign in API modules and codes which works good, generated and placed the google-services.json within /app after generating SHA1 using keytool of debug.keystore and pasted the SHA1 on the google cloud developer console, but now there's only one glitch i am facing since many days/weeks i.e. when i try to do device debuggin and whenever i click on "G+ Sign In" i get the following error in LogCat:
E/GMPM: getGoogleAppId failed with status: 10
E/GMPM: Uploading is not possible. App measurement disabled.
D/SignInActivity: handleSignInResult:false
This handleSignInResult is returning False all the time and not able to sign in to fetch data further. If anyone of you have ever faced such situation please help me out here. This small obstacle is pretty maddening.
Thank you everyone.
Please insure that you had applied SHA-1
debug key in the google-services.json
file creation.
Are you using Plus.API or Auth.GOOGLE_SIGN_IN_API? The latter is the latest revamped one. Check it out here: https://developers.google.com/identity/sign-in/android/sign-in
If you are using Auth.GOOGLE_SIGN_IN_API:
In onActivityResult, use code similar to below and you can get a status code, which is defined by GoogleSignInStatusCodes: https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
int statusCode = result.getStatus().getStatusCode();
}
}
The most common issue is missing the right OAuth2 client registration. (Unfortunately, for now, the status code is INTERNAL_ERROR 8, which is not helpful. ) E.g. Take a look at this thread: Occured an INTERNAL_ERROR when requestEmail from GoogleSignInOptions Android
If you are adding all the SHA-1 Finger prints in firebase still you are getting error.then (I was facing this problem. after this steps it's resolved.)Try this steps:
1.Go to Google Console API credentials Page.
2.Click the credentials in the Left tab.
3.Already two default Android and Web OAuth client Id will be present. You have to create One Android Client and One Web 2.0 Client.
4.Go to Firebase.In project setting ,download google-services.json and paste in app folder.
(Everything is fine but still you are cannot signin google means maybe OAuth problem. so make sure to create Android and Web client ID.Finally in credential page you have 2 Android Client and Two Web client Id.)
you need to provide the SHA-1 hash of your signing certificate on your app
example:
Registered SHA-1s:
CF:4A:A1:0A:BC:84:F2:31:28:C3:BA:A7:A3:A2:36:10:5F:1D:3E:CB and download the config file you created.. and replace to *yourproject/app/google-service.json
//Get google-service.json file tutorial https://developers.google.com/identity/sign-in/android/start-integrating
//how to get SHA-1 https://developers.google.com/android/guides/client-auth
As Sudhanshu Gaur pointed out in this post, try first generate a signed apk using the same key you used to create your json configuration file. Then install it on your device and see whether it works. The reason is Android Studio does not sign your apk when you click "run".
I was stuck on exactly the same problem and this fix worked fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With