Play-games-plugin-for-unity: Authentication error?

Created on 21 May 2017  路  17Comments  路  Source: playgameservices/play-games-plugin-for-unity

My unity app when downloaded from the google play store available to alpha testers, runs fine. However it tries to connect to the google play services( a box appears with a loading circle). This then fails.

I have the most recent version of Play-Games-plugin, and i have all components in the android sdk installed in andriod studios, my bundle is correct, everything is set up in my app and on the dev console. But it just wont connect to the services any help would be brilliant? :|

Most helpful comment

hi,

hey i guess it worked, but i dont think we have to make a new app for this to work.
Thanks @hawkzey

Yes it was not working due to Google App Signing enabled, i guess we have to do some changes to AndroidManifest.xml for Google Play Games Services to work
see here :- https://support.google.com/googleplay/android-developer/answer/7384423
but solution given below also works fine.

[SOLVED]

What i did :-

  1. Google Play Console -> Select your app -> Release Management -> App signing -> App signing certificate : copy SHA-1 (dont copy word 'SHA1:')
  1. 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.

  2. open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now.

All 17 comments

Hi,
Even i have similar problem.
If i Build and Run Directly from Unity , everything works fine.
But When i Rollout a Beta, it shows Sign In Google green box with a loading circle (then accounts -> select beta tester Email), and then nothing.

Beta tester Emails : Open
game save data : off
Testing emails : emails added
testing for Alpha and Beta : both tick (green)

Following log :

05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Auth operation started: SIGN IN

05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Connecting to Google Play...

05-23 12:55:44.522 28917 28948 W Unity : !!! [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 WARNING: Creating new PlayGamesPlatform

05-23 12:55:44.522 28917 28948 W Unity :

05-23 12:55:44.522 28917 28948 W Unity : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

05-23 12:55:44.522 28917 28948 W Unity :

05-23 12:55:44.522 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Activating PlayGamesPlatform.

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating platform-specific Play Games client.

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating Android IPlayGamesClient Client

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Invoking callbacks, AuthState changed from silentPending to Unauthenticated.

05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: there are pending auth callbacks - starting AuthUI

How do you get access to this log file, i would like to review my own, Same with me also if i run it straighy from my phone it sometimes works but not always.

Did you edit tester in google developer console?
I experienced that problem because I didn't edit tester.

@hawkzey
To get Test logs from Device : -
(Android)

  1. Device is ready for Developer Mode and Debugging
  2. Connect Device to computer, Open your Android SDK folder / platform-tools
  3. open CMD or Terminal in this folder, and type : adb logcat
    ( you can also type to store log in a file : adb logcat > log.txt )
  4. Start your game on your device
  5. You will start seeing different logs from the device,
  6. Look out for text related to "unity" , "GamesNativeSDK" and similar.

Ok, So i have found my log thank you @XiveStudio, It must be this 0Auth2 error, However i dont get why this is causing problems as this should be correct as i have connected it to the devloper console.... Any luck?

https://gyazo.com/10097bf3538c3788ed5a3f8a00287eba

No luck, i am changing / re-enabling stuff .. Nothing yet.
i have posted a new question :- https://stackoverflow.com/questions/44153675/google-play-games-service-error-not-authorized-when-rollout-for-beta-unity3

I just realised problem in my project too. I tried to log some info after auth. I get google id and username. But email is empty. Unity 5.6.1p1 , latest plugin version, arr 10.2.6

Guys try putting the Apk file straight onto your phone, does it work?. it connects to the services but if i do it via a alpha test and download it via a link it doesnt >.

Same here, if i direct build and run from PC, the Authentication is working.

But if i remove the app and download from google play store, the Authentication failed.

Any way to fix this?

I have tried everything under the sun and cannot fix it >.<, It works if i put it on my phone but doesn't if i pull it from the store >.<. any one else made progress?

Did any of you guys enable the google signing app thing on the console developer?

Yeah, why? Is it working for you?

Yes, Make a new app and do not allow the google singing app thing that it says you can activate when you are uploading your apk. Disabling this fixed mine.

once enabled you can not disable it you have to make a new application on the console

hi,

hey i guess it worked, but i dont think we have to make a new app for this to work.
Thanks @hawkzey

Yes it was not working due to Google App Signing enabled, i guess we have to do some changes to AndroidManifest.xml for Google Play Games Services to work
see here :- https://support.google.com/googleplay/android-developer/answer/7384423
but solution given below also works fine.

[SOLVED]

What i did :-

  1. Google Play Console -> Select your app -> Release Management -> App signing -> App signing certificate : copy SHA-1 (dont copy word 'SHA1:')
  1. 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.

  2. open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now.

Thanks @XiveStudio for giving the solution. I'm had create a step by step on how to login unity in my blog. Hope this will help someone better.

https://kyokurosagi.blogspot.my/2017/05/unity-local-login-with-unity-android.html

Thanks for the details @kkusanagi and @XiveStudio.

Was this page helpful?
0 / 5 - 0 ratings