- Home /
Google Play Games Services - authentication fails
Hey Unity Community,
first of all, i know that this question isn't raised the first time here, but unfortunately are all ways shown in the other posts to fix the problem not helping me.
The main problem is, that I can't authenticate with Google play when i publish my apk as an alpha build on google play, it tries to connect to the google play services, a box appears then a loading circle. Then nothing, it just fails. However, if I install my game directly with the apk (not from google play) it works and shows all Achievements and Leaderboards i created. This leads me to the conclusion, that there is nothing wrong with my code but something else causes the problem.
Now what i tried to do:
I checked the androidmanifest.xml, package and app id are matching.
I also checked the sha1 hash with the keytool command, it also matches the one in googles api console.
Tried with other google accounts that i also put into the tester list (I also used the link to participate in the test).
Ran logcat while playing, here the two most relevant Logs i repeatedly got: GamesNativeSDK: Play Games callback indicates connection failure.
GamesNativeSDK: UI interaction required to connect to Google Play.
I'm using this Plugin (the newest version): https://github.com/playgameservices/play-games-plugin-for-unity
I really hope that someone here can help me with this. Just ask if you need more informations.
have a nice day!
same here, sadly no one is answering. https://stackoverflow.com/questions/44153675/google-play-games-service-error-not-authorized-when-rollout-for-beta-unity3
Yeah, most of similar questions are several years old and the answers there don't work for me sadly, the questions that got asked recently mostly don't have answers at all.
Answer by Donaris · Jun 07, 2017 at 06:20 AM
Okay, i actually solved it with help of the link @paradox9 posted above (https://stackoverflow.com/questions/44153675/google-play-games-service-error-not-authorized-when-rollout-for-beta-unity3). I'll just copy the steps shown there that fixed it for me:
"What i did :-
Google Play Console -> Select your app -> Release Management -> App signing -> "Upload certificate" [Thanks to @taimur_azhar for pointing out a mistake in the quoted manual] : copy SHA-1 (dont copy word 'SHA1:')
open https://console.developers.google.com/ , select your project -> credentials -> OAuth 2.0 client IDs -> Edit OAuth client -> Signing-certificate fingerprint -> replace the old SHA1 with copied SHA1 ->save.
open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now."
wow thanks ! I just messed up with debugkeystore and my own
PLEASE read the comment below before doing anything else "Listen carefully. Copy SHA-1 from "Upload certificate", not "App signing certificate"." (taimur_azhar). Hope it helps someone =))
Answer by taimur_azhar · Dec 08, 2017 at 01:56 PM
Listen carefully. Copy SHA-1 from "Upload certificate", not "App signing certificate".
THIS. The 'Best answer' is technically wrong. as it says to copy it from the App signing certificate. That will get you nowhere very fast it is the Upload certificate SHA1 you want.
Hopefully this helps someone as I basically just spent the last 4 hours only to find this.
Thank you so muchhh =))) I've spent hours figuring out this.
I changed it in my answer, thanks for clearing that up, it's some time since i asked this question now but maybe some people will still look into this thread and can get it to work :).
Isn't Upload certificate to be used for debugging and app signing certificate to be used after publishing the app??? Because after publishing the app, the keystore is changed again by Google play console.
Answer by mliukka · Jul 22, 2018 at 07:50 AM
To anyone that's still struggling to get the Google Play login to work even after all these solutions: check the "testing" part of your Google Play Services console. After almost a week of trying every solution, redoing everything, double and triple checking the SHA1 keys are correct, I finally happened to look at this section.
You have to add every google account that is allowed to connect to Google Play Services during your testing phase. Your Google developer account is added automatically as a tester so I'm assuming that's why no tutorial even mentions this part (everyone is using the same Google account on their phone and their Google Developer console). I'm using a PERSONAL account to log in to Google Play on my phone, and a SEPARATE developer account, so I had to manually add my personal email as a Tester; after that everything worked like a charm.
This does not work for me either. Tried all the above answers, The original answer was good and then it stopped working as well.
I even put my app in open beta just to be sure. Nothing I do works, logs just give the same:
Setting result error code to: 16
[Play Games Plugin DLL] 07/25/18 22:52:19 +03:00 DEBUG: Starting Auth Transition. Op: SIGN_IN status: 16
[Play Games Plugin DLL] 07/25/18 22:52:19 +03:00 DEBUG: Invoking callbacks, AuthState changed from silentPending to Unauthenticated.
[Play Games Plugin DLL] 07/25/18 22:52:19 +03:00 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED
[Play Games Plugin DLL] 07/25/18 22:52:19 +03:00 DEBUG: AuthState == Unauthenticated calling auth callbacks with failure
Setting result error code to: 16.
I have the same error.How do you deal with that?
I encountered this problem without adding privacy policy (android.permission.READ_PHONE_STATE),maybe, You need to add privacy privileges in the googleplay developer.
And Upload AP$$anonymous$$ to the googleplay developer.
Answer by anonymous_16296 · Jun 05, 2018 at 08:23 PM
I followed the steps provided in the answer however it's still not working for me. Instead of editing the original key I added another Oauth2.0 key for the app. following that change is there an additional step i must take to make sure that this new key works?
BTW, 1 year later and this is still the most relevant post on this topics
Your answer
Follow this Question
Related Questions
Unity 5 - Google Play NO Authentication 1 Answer
Google Play Services authentication problem. Failing to sign in ! 6 Answers
Showing Google Play Game Leaderboard UI not working at all 4 Answers
Google Play Services error 0 Answers
Where can I find the resource definition for google play games android configuration? 1 Answer