Hi everyone, so I got google play console setup and everyting so i got OAuth with client id SHA1 and keystore logged in in project settings, added my self for test user disabled anti piracy. And I setup google play games plugin with manifest client id, i made script which is default one from unity docs for google play games auth and i get Login Unsuccessful I added success to debug and it says canceled??? I tried multiple things just to do google play games auth. Please help I am stuck for 4 days on it.
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
public class GooglePlayGamesExampleScript : MonoBehaviour
public string Token;
public string Error;
void Awake()
//Initialize PlayGamesPlatform
PlayGamesPlatform.Activate();
LoginGooglePlayGames();
public void LoginGooglePlayGames()
PlayGamesPlatform.Instance.Authenticate((success) =>
if (success == SignInStatus.Success)
Debug.Log("Login with Google Play games successful.");
PlayGamesPlatform.Instance.RequestServerSideAccess(true, code =>
Debug.Log("Authorization code: " + code);
Token = code;
// This token serves as an example to be used for SignInWithGooglePlayGames
Error = "Failed to retrieve Google play games authorization code";
Debug.Log("Login Unsuccessful" + success);
Login UnsuccessfulCanceled*** [Play Games Plugin 0.11.01] 01/27/24 18:08:55 +01:00 ERROR: Returning an error code.
I checked everything and redid everything and I never opened google play games app on phone so I never signed in, also i had LD player(android simulator) to check it on pc so i do not have to build and run every time on phone, but LD player i guess had trouble with google play games, so i switched to bluestacks and it works perfectly. So you have on forum.unity.com official google play games how to connect tutorial follow that and try it u have to have keystores matching sha1 matching and setup oauth correctly also you need to add user email into testers, one you use in google play games u can go in Google play games and check on right top corner which email are you using. So I think for me problem was LD player and that i forgot to sign in on phone into Google play games, but idk it just worked.
This took me AGES to figure out , but the problem (in my case) was this :
in google play console > Play Games Services > Setup and management > Configuration > Use next generation IDs this needs to be set to “Off”… PLUS you need to clear cache / data of the already installed app.
I found this out by reading the issues here :
github.com/playgameservices/play-games-plugin-for-unity
**Describe the bug**
If we tick: `Use next generation IDs` option in the config… uration of Google Play Services in the Google Play Console, the plugin doesn't work at all, failing to log in.
**To Reproduce**
Steps to reproduce the behavior:
1. Have a working integration of the plugin in Unity.
2. Go to Google Play Developer Console -> Play Game Services -> Configuration -> Edit Properties
3. Check `Use next generation IDs`
4. Clear data of your app and Google Play Games/Services/Store so you simulate a new install
5. Start the game
**Expected behavior**
Login should work
**Observed behavior**
Login doesn't work and we get the infamous `Returning an error code.` in the console.
**Additional context**
If we uncheck `Use next generation IDs` and clear all the data, then it would work again.
For anyone else who is running into this problem, I solved it a different way:
My issue was that the Google Play Store API connection was working perfectly when I built it locally, but not when it was downloaded via the Play Store during Internal testing.
This is because you need to have a different set of OAuth Credentials created in the Google Cloud Console (Google Cloud Console → APIs And Services → Credentials → OAuth 2.0 Client IDs).
When you create the “production” set, you want to use the SHA-1 Certificate Fingerprint that can be found in your Google Play Console under Setup-> App Signing.
I felt really dumb when I realised this, but this has stumped me for over a month and I hope helps someone else!
This is an issue that’s been haunting me and my team for almost a year now, as GooglePlayGames is very hard to debug due to the logs being Returning an Error Code without specifying the error itself (Logging practices to the finest I guess…)
We are still trying to figure out what is the root cause of this issue, since it is present on our user error logging tool, which can lead to some users not being able to fully interact with the game (i.e.: using cloud-saves)
For now, we’ve discovered the following:
Setting the Default Account to Ask Every Time on the Play Games App (Android) will cause 100% fail-rate and the cancelled message
This is extra damaging as the account you may pick when Asked to Login will be kinda-of glitched indefinitely, and will always return Canceled regardless if you uninstall your game, PlayGames app or reset the phone.
Changing the account to another one solved the issue for us
As mentioned, there were no finding on the exact cause of our problem, but take notes that:
It is worthy to double-check your app configuration on Google Play Games:
Be sure to Add the proper SHA1 keys for all keystores you have (usually development AND production)
This is not very well documented but in some services (such as Firebase App Distribution) your app is re-signed with another key. You MUST add it to your PlayGames configuration as well
Try switching your account on GooglePlayGames to another one, as mentioned earlier some accounts will be “glitched” and will always return Canceled as statuses
As per the symptoms we strongly believe that this is caused due to Background-Login & the combination of picking the account for yourself. The GooglePlayGames Unity Plugin is wildly outdated, perhaps there is a flow where the app will not be “trusted” to auto-login (and furthermore, give us the issue) although we are not sure. As we find anything new, I’ll be updating it here
hey @brenoPixodust , thank you so much for these notes. After trying for hours yesterday, today I decided to switch my account on Google Play Games App and when joining my App, the authentication works again.
Also, after testing with the 2nd account for some time, I decided to set the 1st account again (cleanup my App stored data) and this 1st account can successfully authenticate again.
Very weird. Now I’m wondering if that issue would happen to players in production
Hello, I’ve spend some time trying to make it work. Here are some discoveries I made.
You have to create a Android OAuth client and a backend one (if you need), looks like play games automatically detects the android one.
Google Play Internal Sharing(the one generating internal download links) uses another app signature, so be aware of that when configuring the client.
I’ve found some useful logs in android logcat, but they were not in my app logs, it was in another process, so make sure to have the search filter disabled
I was getting redirect_uri_mismatch from PlayFab, the issue disappeared when creating the App Links for our domain , but I’m not sure if this was the fix or just luck.
Still an issue with GooglePlayGames (GPG) 2.0.0 and Unity 6000.0.41f1 .
I have tried all the above methods and no matter what, after selecting any profile, trying automatic and manual authentication, I get this “error” (warning):
2025/03/14 15:03:24.518 2603 2744 Warn Unity *** [Play Games Plugin 2.0.0] 03/14/25 15:03:24 -04:00 ERROR: Returning an error code.
2025/03/14 15:03:24.518 2603 2744 Warn Unity UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
2025/03/14 15:03:24.518 2603 2744 Warn Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
2025/03/14 15:03:24.518 2603 2744 Warn Unity
The status always comes back as “Cancelled”.
I also have:
Firebase 12.7.0 installed:
Analytics
Crashlytics
AppCheck (plugin installed, but not currently used).
Authentication
RemoteConfig
Firebase Cloud Functions
AdMob (Google Mobile Ads) v.9.6.0 installed
There was a known incompatibility (gradle build conflict) with GPG and AdMob at one point earlier this year, but updating the versions corrected that. I wonder
just realized, Google Play Games was not installed!
Like really? google didn’t even give me a error that “You are missing our Most Important App”
Stupid google…
I’ve wasted two days on this issue as well and want to share my experience for others who might come across the same problem.
If you’ve rotated your SHA-1 key in the Google Play Console, you still need to use the Legacy Key for the GPGS OAuth client.
I built the .aab, uploaded it for internal testing, downloaded it to my own phone via the Play Store, and tried to connect with GPGS — but received a “canceled” response.
In my early attempts to fix this, I requested a key rotation in the Google Play Console. There’s an option for this below the app signing key on the App Integrity page. This turned out to be a huge mistake.
I updated the OAuth client settings and linked them to my app, but I still wasn’t able to connect to GPGS. After digging into this for two days, I reconfigured the OAuth client settings using the old (legacy) key — one of the very last things I thought to try — and it worked!
ChatGPT came up with the following information about this:
When you first configured Google Play Games Services (GPGS) , it was internally linked to the original app signing certificate (SHA-1) — this is referred to as the Legacy Key .
Even if you later rotate your signing key in the Play Console (activating the “Latest” key), GPGS continues to expect the original SHA-1 .
The system does not automatically switch to the new SHA-1, even if you update your OAuth clients.
Even if you create a new OAuth 2.0 client with the new SHA-1 in the Google Cloud Console , and properly assign it to your GPGS configuration in the Play Console, GPGS still expects the original SHA-1 unless Google manually migrates it — which is not currently supported publicly .
I’m not sure how technically accurate this explanation is, but it definitely matches my experience.
You can find the legacy key using the dropdown menu on the App Integrity page. Look at the new app signing key — the dropdown in the top right should say something like “App signing key: latest.” Click it to switch to “Legacy.”
Hope this helps.