1

I implemented sign in using google in my android app.

I followed the steps mentioned on their developer page, used the sample code, generated the google-services.json file. The sign in worked.

Suddenly after two days the same apk could not sign in successfully.

The code fragment giving error is:

GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);

The result.isSuccess() method returns false, indicating sign in has failed.

The error log gives error:

DEVELOPER ERROR resolution = null

Is it some issue with google-services.json ? Why did it stop working suddenly ?

Abhishek Patel
  • 4,280
  • 1
  • 24
  • 38
Ashish kulkarni
  • 644
  • 2
  • 7
  • 13
  • Try agiain to generate `google-services.json` file. – Praval Sharma Jun 06 '16 at 06:16
  • 1
    I generated a new google-services.json file two days back, the code worked and again it is not working now. The apk file installed in phone stopped working after two days on its own, no changes in code. – Ashish kulkarni Jun 06 '16 at 10:54
  • I suggest looking in the log for clues on what is going wrong during sign-in? usually there is some sort of error message. – Clayton Wilkinson Jun 07 '16 at 06:02
  • @Ashishkulkarni I'm also having the same problem. I was trying to regenerate keys 3 times, but each time they stop working after some time (without any changes in code). Did you solve it somehow? – Serhiy Jun 04 '18 at 08:24
  • @Serhiy: Are you building the code on different machines (as the api is linked to machine's sha code)? Usually, once you build your code with one new key, it should not stop working until the next rebuild. A naive suggestion would be to generate keys each time you are building and distributing your app. – Ashish kulkarni Jun 05 '18 at 16:42
  • @Ashishkulkarni, no I work on single machine. Basically, I run app on device and authorization works. Then, after a few hours it stops working on this device without even reinstalling the app. – Serhiy Jun 06 '18 at 07:49

1 Answers1

1

There can actually be many reasons why we encounter sign-in failures after already achieving it successfully. You may check the following:

  1. One probable cause can be with implementing player sign-in.
    • It could be that the user signed in successfully before and has not signed out, then the system calls onConnected() method. If sign in fails, the system calls the onConnectionFailed() method. To resolve the connection failure, you can implement code as given in the documentation.
  2. You may also go through Troubleshooting Issues in Your Android Game to see if you've missed out something like setting up your game correctly.
  3. Then, this SO post - Google Play Game Services - unable to sign in might also come in handy if the two didn't work.
  4. Lastly, add in your app some implementation techniques to provide a seamless user experience, as recommended by the sign-in best practices.

Hope one of those help with your issue. :)

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22
  • Thanks for the help ! Currently generating a new google-services.json file for a new project solved the issue. Will see if it stops working again now. Will also implement your suggestions. – Ashish kulkarni Jun 07 '16 at 11:48