Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Can't sign in with Google Play Games Services

Discussion in 'Android' started by ShadowZie, Apr 18, 2023.

  1. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    Hey, I am trying to sign in with google play games, I set up the code as they showed on GitHub and I added myself as a tester but it's still not working

    this is the logcat that I receive :

    2023/04/18 18:10:07.816 18930 19006 Info Unity [Play Games Plugin 0.11.01] 04/18/23 18:10:07 +03:00 DEBUG: Activating PlayGamesPlatform.
    2023/04/18 18:10:07.817 18930 19006 Info Unity [Play Games Plugin 0.11.01] 04/18/23 18:10:07 +03:00 DEBUG: Initializing the PlayGamesPlatform instance.
    2023/04/18 18:10:07.817 18930 19006 Info Unity [Play Games Plugin 0.11.01] 04/18/23 18:10:07 +03:00 DEBUG: Creating Android IPlayGamesClient Client
    2023/04/18 18:10:07.817 18930 19006 Info Unity [Play Games Plugin 0.11.01] 04/18/23 18:10:07 +03:00 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
    2023/04/18 18:10:14.828 18930 19006 Info Unity [Play Games Plugin 0.11.01] 04/18/23 18:10:14 +03:00 DEBUG: Starting Auth using the method isAuthenticated
    2023/04/18 18:10:14.851 18930 19006 Warn Unity *** [Play Games Plugin 0.11.01] 04/18/23 18:10:14 +03:00 ERROR: Returning an error code.

    I am getting this +03:00 ERROR: Returning an error code. and I can't find any info about it :/

    what should I do?

    Thank you
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    Share complete logcat log without any filters (text filters).
     
  3. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    thank you this is the full log


    2023/04/18 22:08:51.418 20386 20478 Info Unity [Play Games Plugin 0.11.01] 04/18/23 22:08:51 +03:00 DEBUG: Starting Auth using the method isAuthenticated
    2023/04/18 22:08:51.418 20386 20478 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    2023/04/18 22:08:51.418 20386 20478 Info Unity
    2023/04/18 22:08:51.450 20386 20478 Warn Unity *** [Play Games Plugin 0.11.01] 04/18/23 22:08:51 +03:00 ERROR: Returning an error code.
    2023/04/18 22:08:51.450 20386 20478 Warn Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    2023/04/18 22:08:51.450 20386 20478 Warn Unity
    2023/04/18 22:08:51.484 20386 20478 Info Unity statusCanceled
    2023/04/18 22:08:51.484 20386 20478 Info Unity FacebookAppleGoogleLogin:processAuthentication(SignInStatus)
    2023/04/18 22:08:51.484 20386 20478 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    2023/04/18 22:08:51.484 20386 20478 Info Unity
    2023/04/18 22:08:51.484 20386 20478 Info Unity Canceled
    2023/04/18 22:08:51.484 20386 20478 Info Unity FacebookAppleGoogleLogin:processAuthentication(SignInStatus)
    2023/04/18 22:08:51.484 20386 20478 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
     
  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    The log is still with Unity text filter. Share a complete logcat log.
     
  5. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    I fixed it it was a problem with the testers
    it worked on local devices but when I upload it to the google play its stopped working

    +03:00 ERROR: Requesting server side access task failed - com.google.android.gms.common.api.ApiException: 10:

    I have read that its something with the sha1 hash so what I did is I created a new OAuth 2.0 Client IDs with the google generated sha 1 hash and then I changed it in the configuration and I updated the client id on unity but still nothing

    is there another place that I need to update for the new sha 1 hash? so it will work with google play and not local builds
     
  6. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    Yes, this means SHA fingerprint of play store build is not listed in the google play console!
    Have a look here on how to add these fingerprints.

    Cheers,
    VB Team
     
  7. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    Hey thank you,
    this is the thing I tried it
    I took the play store hash from the app signing
    and then I replaced the old hash with the new one
    I can see it in the Configuration -> then on Credentials I clicked on the arrow and I see the correct
    Fingerprint
    and I still see this error with the build that I installed from the internal testing

     
  8. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    Ok.
    Share me complete logcat log. Else, It's tough to guess what is the exact error.
     
    ShadowZie likes this.
  9. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    Sorry not sure how I missed that but I get this

    Error PlayGamesServices[SignInAuthenticator] **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
    Error PlayGamesServices[SignInAuthenticator] **** DEVELOPER_ERROR
    Error PlayGamesServices[SignInAuthenticator] **** This is usually caused by one of these reasons:
    Error PlayGamesServices[SignInAuthenticator] **** (1) Your package name and certificate fingerprint do not match
    Error PlayGamesServices[SignInAuthenticator] **** the client ID you registered in Developer Console.
    Error PlayGamesServices[SignInAuthenticator] **** (2) Your App ID was incorrectly entered.
    Error PlayGamesServices[SignInAuthenticator] **** (3) Your game settings have not been published and you are
    Error PlayGamesServices[SignInAuthenticator] **** trying to log in with an account that is not listed as
    Error PlayGamesServices[SignInAuthenticator] **** a test account.
    Error PlayGamesServices[SignInAuthenticator] **** (4) A server auth code was requested, but an incorrect client
    Error PlayGamesServices[SignInAuthenticator] **** id was provided. The client id for server auth codes should
    Error PlayGamesServices[SignInAuthenticator] **** be the client id for the game server (not the android app).
    Error PlayGamesServices[SignInAuthenticator] ****
    Error PlayGamesServices[SignInAuthenticator] **** To help you debug, here is the information about this app
    Error PlayGamesServices[SignInAuthenticator] **** Package name :
    Error PlayGamesServices[SignInAuthenticator] **** Cert SHA1 fingerprint:
    Error PlayGamesServices[SignInAuthenticator] **** App ID from manifest :
    Error PlayGamesServices[SignInAuthenticator] ****
    Error PlayGamesServices[SignInAuthenticator] **** Check that the above information matches your setup in
    Error PlayGamesServices[SignInAuthenticator] **** Developer Console. Also, check that you're logging in with the
    Error PlayGamesServices[SignInAuthenticator] **** right account (it should be listed in the Testers section if
    Error PlayGamesServices[SignInAuthenticator] **** your project is not yet published).
    Error PlayGamesServices[SignInAuthenticator] ****
    Error PlayGamesServices[SignInAuthenticator] **** For more information, refer to the troubleshooting guide:
    Error PlayGamesServices[SignInAuthenticator] **** http://developers.google.com/games/services/android/troubleshooting
    Error PlayGamesServices[SignInAuthenticator] ****

    the Cert SHA1 fingerprint that its showing me is the same as the sha1 that google give me when I uploaded the app
    and I am in a test account
    and package name , id is match

    what does it mean by Your game settings have not been published ? if I am internal how do I publish it without going info the store

    thank you
     
    Last edited: Apr 19, 2023
  10. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    I got this aswell

    Code (CSharp):
    1.  
    2. 2023/04/19 16:37:10.051 8137 8150 Warn Auth [GetTokenResponse] No token found in response, service=oauth2:server:client_id::api_scope:https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/games_lite [CONTEXT service_id=153 ]
    3.  
    4.  1
    5.  14665 Warn ReqServerSideAccessOp Authorization request failed: request [dpq{clientPackageName=packagename, clientUid=10638, account=<ELLIDED:-448610249>, requestedScopes=[https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/games_lite], shouldIncludeAllGrantedScopes=false, gamesAutoSignInPolicyAction=APPLY, , forceRefreshToken=false}], status [Status{statusCode=DEVELOPER_ERROR, resolution=null}] [CONTEXT service_id=1 ]
    6. Info GetServiceValidatorImpl onGetService() from Client SDK version [224617000], Module version [224617045], PGA version [369962040], Account [Account {name=<<default account>>, type=com.google}], Calling package [com.google.android.gms], Game package [com.google.android.gms] [CONTEXT service_id=1 ]
    7.  18084 Warn GetGamesServiceReqFacto Parsing request with ignored arguments. signInOptionsBundle [Bundle[{com.google.android.gms.signin.internal.serverClientId=null, com.google.android.gms.signin.internal.usePromptModeForAuthCode=true, com.google.android.gms.signin.internal.logSessionId=null, com.google.android.gms.signin.internal.hostedDomain=null, com.google.android.gms.signin.internal.offlineAccessRequested=false, com.google.android.gms.signin.internal.waitForAccessTokenRefresh=false, com.google.android.gms.signin.internal.clientRequestedAccount=Account {name=<<default account>>, type=com.google}, com.google.android.gms.signin.internal.idTokenRequested=false, com.google.android.gms.signin.internal.forceCodeForRefreshToken=false}]], isRetryingSignIn [false], skipWelcomePopup [false], requireGooglePlus [false]
    8.  
    9.  
     
    Last edited: Apr 19, 2023
  11. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    This log displays an SHA fingerprint. Just add it in your google play console. It should work.
     
  12. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    Its already there :( is it because I am in internal build and not alpha ?
    and its matching
     
  13. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    I am not really sure what to do :/ I have been trying for the last 8 hours nothing works
     
  14. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    The log you shared will have the sha fingerprint which is expected by the google auth.

    I see you stripped the contents again to share the exact SHA. So you should be able to figure out after checking the complete log.
     
  15. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    I checked and everything match

    I added 3 sha-1 hashes
    1. from my key stone
    2. from debug keystone
    3. the google signing keystone

    the id on the error does match the id on the google console

    and the package name matches the Credentials

     
  16. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    ok. Check once if App Id (Play Services Application Id) is properly configured. Also, if you recently added, give some time to propagate. I assume you already added your self as a tester in "Grow -> Play Services -> Testers" section in google play.
     
  17. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    about the app id how can I check if its properly configured?
    and yes I added myself as tester
     
  18. edaw22

    edaw22

    Joined:
    Aug 20, 2012
    Posts:
    14
    Did this ever get resolved? I am experiencing the same error.
     
  19. ShadowZie

    ShadowZie

    Joined:
    Nov 5, 2017
    Posts:
    70
    nope I still have the same error
    I think its something from their side
     
  20. nestorortiz017

    nestorortiz017

    Joined:
    Oct 23, 2020
    Posts:
    8
    Same error here!
     
  21. nestorortiz017

    nestorortiz017

    Joined:
    Oct 23, 2020
    Posts:
    8
    i had the same error, all was well configured in Google Play Console and Google Cloud, everything was right, i could fixed it by updating Google Play Services to 0.11.01 version, i don't know what was wrong, but that fixed my problem.

    Here is the link of the package if someone wants to try this:
    https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/current-build

    And here is the documentation of how to implement this new version:
    https://developer.android.com/games/pgs/unity/unity-start?hl=es-419