简体   繁体   中英

Achievements in Google Play Games is not working

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 ie 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

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 :DI will now try to add leaderboard :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM