I am trying to make simple game with Google Play Games Services, but I failed to sign in to Google Play Games.
I get this error:
For me its that my project SHA1 is not the same as what is in the API console.
1. I've checked mine through this.
2. Went to https://console.developers.google.com and into the "Credentials" page of my project.
3. Clicked on the edit button (the pencil icon) and pasted over the SHA1
4. Worked within <2 minutes
I have solved this problem, so I will post the answer.
I have moved app id and leaderboard id from strings.xml to ids.xml in values folder.
I have deleted all client ids and add again client ids for debug keystore and release keystore.
In my case,I only add a release client ID in Google Play Console. When I run my app by click button RUN in AS,the network connection error show.But when I run the apk generated by the signed,it work well. So, add a debug client id if you want to run your app inside AS.
In my case.I setted one test account,but my device has an default account which is another,that's why I got this error.My mistake but Why can't google gives us an more obvious error report?
Here is how I worked this out.All my test was under debug version using test account. I delete the project, both in google play develper console and google Api console.And recreate one as mentioned by others on stackoverflow.But this does't help.I redo this and ends up in vane.
I cheked found in log these same words:
03-09 16:15:39.897: E/GameAgent(1225): Unable to retrieve application xxxxxxx from network 03-09 16:15:39.902: E/GameAgent(1225): Application ID xxxxxxx is not associated with package com.gyj.pub.gpgsDemo. Check the application ID in your manifest. 03-09 16:15:39.906: E/CheckGameplayAcl(23917): Unable to load metadata for game 03-09 16:15:39.906: W/SignInActivity(23917): onSignInFailed()...
one more,I checked all the 3 elements below ,decide whether the client apk is conform with Google Play Deverloper Console's configuration. 1.package name .It is all the same. 2.Certification SHA1 fingerprint.(debug and release). 3.test Account.
Even at that time I did not realize that I haven't input an account during my tests,How does the device know which account is attend to sign in? I tried an other account.I added this account which has setted in sonsole as Test Account to the device,relaughched the TypeANumber app.It showed me a view to choose one from the two accounts.Suddently I got it.
In my case the problem was one of gmail accounts (out of two) was not added to the testers accounts at the play store and was the default account for my device.
I removed the account to make the other account (testers account at playstore) default and added it back again, and it started working
If you haven't published your app/game: After you done every usual step, make sure you test your app/game with a device has only the test account/s. I checked every step a few times and ended with this weird problem. Lastly i tested my app with a device has only test account i added on Developer Console. It worked. Hope, this helps someone else.