0
votes

I created a small game on android with libgdx (runner game) which is working fine.

So I decided to add some achievements to it.

My application is published, when I go to Services and API, I see "this application use google play's services...".

So I go in "Game services" menu. My game is here with the API :"API Google+, Google Play Game Services i.e Google Play Game Management ". In the associated application menu, I have my application linked.

When I open the game for the first time, it ask me to connect with my google account, so the sign-in method work fine. After the connection, I see my profile pictures with my play games level. But when I want to unlock achievements, nothing append. I don't think the problem is in the code because the connection run fine and the game is not crashing, there is just nothing append and the game continue. Maybe I miss something on the configuration on the play console because when I open the game in Google Play Games, I see my games but there is no achievements/leaderboard see pictures :

Achievements in dev console

No achievement in play games

To see if the sync is okay, I modified the game's description and go back to the play games, the description was modified.

So why my achievements are not on the play game service and due to that I'm not able to unlock them ? I really don't understand what I missed... Thanks in advance for your help.

Edit : Also on the API explorer, when I want to execute a simple games.achievementDefinitions.list to get the list of achievements in my application, I get an error :

i.stack.imgur.com/gRwNh.jpg

i.stack.imgur.com/0DRAR.jpg

Telling me that the API is not enabled but it is !

i.stack.imgur.com/DPxId.jpg

1
Is the project you added into Game Services is the same one which you've enabled APIs for in the Developer Console? Do they also have the same credentials (clientID)? Also, please try enabling Google Play Android Developer API and maybe even Google Play Game Services Publishing API. These two APIs are enabled by default when you create a new project through Game Services tab, so they may be necessary.Andy
Yes I think it is the same : when I go to the Game Services, the package name is the same, also when I registered my application in Game Services, I put the SHA1 key found in my project using keytool.. What do you mean by "credentials (clientID)" ? I did nothing with that :/ I also see something really strange, android studio in my build.gradle say me that I misses the sdk Google Repository but it is installed ! See screenshoot : imgur.com/a/fosPDMorgan Senechal
Also, when I go in my play games (on smartphone) if I open my game, (the second screenshoot) if I click on the play store it's correctly link with my app (you can try here is my app : play.google.com/store/apps/…)Morgan Senechal

1 Answers

2
votes

I finally found where was the mistake. Thanks to this sample :

https://github.com/playgameservices/android-basic-samples under BasicSamples=>TrivialQuest2.

When I created google api client, I forget to add the Games API, so I just added .addApi(Games.API).addScope(Games.SCOPE_GAMES)

Now my game works fine and I can unlock/get achievement for a player :D I will now try to add leaderboard :)