google-services icon indicating copy to clipboard operation
google-services copied to clipboard

Google sigin in :: gives error code 8 and 12501 many times.

Open niteshgoel opened this issue 10 years ago • 41 comments

I have added services.json and i provided sha1 key and tested on samsung s3 phone, still it gives me error code 8 when i do result.getStatus().getStatusCode() and result.getStatus().getStatusMessage() is null on Nexus 5 running marshmallows.

niteshgoel avatar Jan 20 '16 12:01 niteshgoel

@niteshgoel are you saying that you only see this issue on the Nexus 5, or you see it on both the Nexus and the Samsung Galaxy S3 devices?

samtstern avatar Jan 20 '16 16:01 samtstern

Only on Nexus 5 and on one of my system only. hey i have already attached my code in another question (showing bar on login.)

niteshgoel avatar Jan 20 '16 16:01 niteshgoel

What is the version of Google Play Services on each device? Did you install Google Play Services manually via apkmirror or similar?

Code 8 is CommonStatusCodes.INTERNAL_ERROR so it's hard to diagnose when it is device specific.

samtstern avatar Jan 20 '16 16:01 samtstern

How to get the Google play service version on device. On Studio it is 8.3. no i have not install Google Play Services manually.

niteshgoel avatar Jan 20 '16 16:01 niteshgoel

You can go to Settings > Apps > Google Play Services to get the version.

samtstern avatar Jan 20 '16 16:01 samtstern

Google Play Services version on s3 and and nexus 5 is : 8.4.89

niteshgoel avatar Jan 21 '16 09:01 niteshgoel

I have same problem, it's working very well on my note 2 (Android 4.4.4), but always get INTERNAL_ERROR on my Note 5 (Android 5.0.2)

ghost avatar Jan 21 '16 10:01 ghost

Same thing happens here. It gives me error code 8 on Moto G only, the code works on other devices.

alexjuniodev avatar Jan 23 '16 21:01 alexjuniodev

@niteshgoel a few questions so we can debug this:

  1. Was the adb log grabbed from Nexus 5 orSsamsung s3?
  2. Did you see an account chooser dialog and pick an account before seeing the error?
  3. Would you mind sharing the name of the account you used on the device with the error? Could you try a different account? Is there any chance he disabled "Auto-sync data" for that account?
  4. Could you try modifying your code to this:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder()
                .requestEmail()
                .build();

and see if it's working?

samtstern avatar Jan 25 '16 20:01 samtstern

@samtstern : answers

  1. Which adb log you are talking about.The one which I have attached in another question was from s3.
  2. Yes.
  3. I can not tell you the name. How i can test on a users phone about "Auto-sync data" from my code.
  4. After this i am getting 12501 error code from (googleSignInResult.getStatus().getStatusCode()) in handleSignInResult(GoogleSignInResult result) function.

NOTE : Now I have tested on few more devices with different account and I am getting the same error. Please help me asap as I need to launch my application And with this bug i can not.

niteshgoel avatar Jan 26 '16 19:01 niteshgoel

@samtstern please tell me if we can have a live conversation to debug this.

niteshgoel avatar Jan 26 '16 19:01 niteshgoel

@niteshgoel have you ever gotten a successful sign in on this device? Also could you provide a full adb bugreport for a situation where you get the 12501 response? Email it to [email protected] and we will analyze it.

samtstern avatar Jan 26 '16 23:01 samtstern

@samtstern: I have mailed you all the details.

niteshgoel avatar Jan 27 '16 13:01 niteshgoel

For all who are getting this error, make sure you have registered ALL of your signing keystores in the developers.google.com/mobile/add flow. Failing to register one of your keystores (such as your production keystore) will result in INTERNAL_ERROR if you ask for the default GoogleSignInOptions configuration plus email.

samtstern avatar Jan 27 '16 21:01 samtstern

@samtstern : Yes there was one keystore missing but From another keystore which was already added, it is working on one device but not on nexus5 as i am building from the same machine.

niteshgoel avatar Jan 28 '16 06:01 niteshgoel

@niteshgoel Could you double check the version on Nexus 5?

There's an easy way for you to tell whether it's registered correctly. Change your GoogleSignInOptions to be: GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .requestScopes(Scopes.DRIVE_APPFOLDER) .build();

If your version isn't registered correctly (package name + sha1 key), you will see one row saying "Unregistered Android application" on consent dialog. See attached screenshot. screen shot 2016-01-27 at 11 18 06 pm

isaisachen avatar Jan 28 '16 07:01 isaisachen

@samtstern FYI; I just build & run the sample code of yours, and it's working very well without getting INTERNAL_ERROR @ device:

  • Samsung S4 (Android Jelly Bean 4.2.2)
  • Samsung Note 2 (Android Kit Kat 4.4.2)
  • Samsung Mega 5.8 (Android Jelly Bean 4.2.2)

but get INTERNAL_ERROR @ device:

  • Samsung Note 5 (Android 5.1.1)
  • Samsung J7 (Android 5.1.1)
  • Xiaomi Mi4i (MIUI 7.1 Android 5.0.2)

GoogleSignInOptions gso = new GoogleSignInOptions.Builder() .requestEmail() .build(); There is no error when i using this code, but I only can get the email data. I think I already registered ALL of my signing keystores. Thanks.

ghost avatar Jan 28 '16 08:01 ghost

@1step are you running the exact same APK on each device? Can you try diagnosing possible registration errors by using the method @isaisachen suggested?

samtstern avatar Jan 28 '16 17:01 samtstern

https://drive.google.com/file/d/0B3sKMOzQgrmwUXdnNFV5U0NEbWc/view?usp=sharing

That is a link to an APK I just built from source, signed with my own debug keystore. The SignIn and SignInWithDrive activities should work.

Please load that APK onto your devices (adb install -r -d) and then test. If you still get an error then we can continue to debug. If you do not get an error with my APK, then it is almost certain that your keystores are not properly registered.

samtstern avatar Jan 28 '16 17:01 samtstern

@samtstern ok, it's working very well. but i still don't understand, why my keystore doesn't work with android os >= 5. let me check it again. Thanks again mate.

ghost avatar Feb 01 '16 02:02 ghost