- Home /
Google Play Services doesn't work
I'm having an Android project where I'm trying to implement Google Play Services for Leaderboards and cloud saving. I downloaded the asset from Github, distributed my game on google play as beta, set the play services api, created leaderboard and everything, and configured the asset accordingly in Unity. The problem is that the login code, does not work for me, nothing happens when I try to run it.
Social.localUser.Authenticate((bool success) => {
});
First I put it in void Start() , because I wanted to make it auto login when the game is being opened. Then I also added a button with the same functionality, but nothing happens when I push it, ot at game start. using GooglePlayGames; and using UnityEngine.SocialPlatforms; is also present in the script, and accesses are set in Google Developer Console too, everything is distributed. Google Play Services API is also up to date like all the Android SDK. So basically I have no idea what could be wrong, because the game is not freezing nor giving any errors when I'm trying to run it on my phone. I really phone that someone will be able to give me a solution.
Is the callback returning anything at all? did you updated fingerprint of your keystore (sha1) to the developer console?
Whenever I get a problem with this plugin I go into its GooglePlayGames/OurUtils/Logger.cs file and print all d() e() and w() logs to a GUI element on the screen so I can see them directly in my build.
You're running this on a build and not in the editor, right? Run a sample project from the Github page and see if authentication works for you there. If it doesn't work, it's less likely to be a problem with your code and more likely to be a problem with your phone (perhaps if your phone is rooted.)
Note that authentication will take a considerably longer time to execute on a low-end phone or a phone with a weak internet connection. But since you said you get the "Authentication failed" message, you must already know how long it takes on your particular phone.
I got this message in the editor not in the build. On my phone simply just nothing happens. But it is a good idea to print out the debug messages on the ui so I could see what is happening on my phone when nothing happens.
I added a UI text and made it to say Success or Failed based on the outcome of the login. In the editor it is working, showing failed. But in the build, again, nothing happens, it doen't show success or failed either, it just stays as new text, like if the code would not be there... I really have absolute no idea what the hell is the problem...
It's better to add UI printing code to the Logger.cs d()/w()/e() methods to get the debug messages directly from the back-end code of the plugin so you can see the authentication progress rather than its success/failure.
Answer by bojan1986819 · May 19, 2015 at 06:50 PM
I found the solution. There was no problem with my code. Simply the Asset import was not correct. I deleted the Google Play Services asset and then simply reimported it and now it is working 100%
Hey man, did u manage to implement the Google Cloud Save successfully?
Answer by wuym67123 · Jan 03, 2017 at 08:28 AM
https://github.com/unity-plugins/google-service-unity plugin include google remote config.
Your answer
![](https://koobas.hobune.stream/wayback/20220613195905im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[Google Play Games Unity Plugin] - Accepting invites room connection fail - ShutdownState 0 Answers
Creating custom Leaderboard using Google Play Games plugin for Unity 1 Answer
Google Play Games Quest reward? 1 Answer
How to google plus share in unity for Android games 0 Answers
Google Play Services: Authentication Failed always 0 Answers