I have a question regarding the Google Play Games v2 SDK. I’m trying to integrate Google Play Games with PlayFab, but when I push the button to connect, I keep getting this error: “Google Play auth error: Canceled.”
This is the code I’m using for authenticating and linking Google Play Games with PlayFab.
I have completed all the Play requirements (APIs, IDs, etc.). I obtained the API from the Play Console and inserted it into the setup.
I believe the setup is correct regarding the APIs, IDs, and related configurations. The issue might be in my code.
One more question: Could the issue be related to the SHA-1 key needing to be the production one? Could it be that it doesn’t work during closed testing or with APKs generated between the PC and the mobile device?
Sources used: Unity 2022.3.62f1 Android google play games services v2
Because on play console i also have this configuration step uncompleted: enter image description here
This is the code:
using UnityEngine;
using PlayFab;
using PlayFab.ClientModels;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using static Popup;
using TMPro;
public class GooglePlayFabAuth : MonoBehaviour
{
public TMP_Text AuthStatus;
private void Start()
{
PlayGamesPlatform.Activate();
// Check authentication status at startup
if (PlayFabClientAPI.IsClientLoggedIn())
{
AuthStatus.text = “Authenticated”;
}
else
{
AuthStatus.text = “Not Authenticated”;
}
}
#region Google Link Process
public void StartGoogleLinkProcess()
{
// Step 1: Check if you are authenticated in PlayFab
if (!PlayFabClientAPI.IsClientLoggedIn())
{
Popup.Show(“You are not authenticated in PlayFab. Please log in before linking your account.”);
return;
}
// Step 2: Authenticate with Google Play Games
if (!PlayGamesPlatform.Instance.IsAuthenticated())
{
Debug.Log(“Starting authentication with Google Play Games…”);
AuthStatus.text = “Authenticating with Google…”;
// Change here:
PlayGamesPlatform.Instance.Authenticate((status) =>
{
if (status == SignInStatus.Success)
{
Debug.Log(“Google Play Games authentication successful.”);
// If authentication succeeds, continue with linking the PlayFab account
ContinueGoogleLinkProcess();
}
else
{
Debug.LogError("Google Play Games authentication failed. Status: " + status);
Popup.Show(“Google Play Games authentication failed.”);
AuthStatus.text = “Google Authentication Error”;
}
});
}
else
{
// If you are already authenticated with Google, go directly to the linking process
ContinueGoogleLinkProcess();
}
}
private void ContinueGoogleLinkProcess()
{
Debug.Log(“Starting Google account linking process…”);
AuthStatus.text = “Linking…”;
PlayGamesPlatform.Instance.RequestServerSideAccess(false, (string serverAuthCode) =>
{
if (!string.IsNullOrEmpty(serverAuthCode))
{
Debug.Log(“Server Auth Code obtained.”);
Popup.Show(“Linking account…”);
LinkGoogleAccount(serverAuthCode);
}
else
{
Debug.LogError(“Could not obtain Server Auth Code.”);
Popup.Show(“Error obtaining Google authentication code.”);
AuthStatus.text = “Error”;
}
});
}
private void LinkGoogleAccount(string serverAuthCode)
{
var request = new LinkGoogleAccountRequest
{
ServerAuthCode = serverAuthCode,
ForceLink = false,
};
PlayFabClientAPI.LinkGoogleAccount(request, OnGoogleLinkSuccess, OnPlayFabError);
}
#endregion
#region Callbacks
private void OnGoogleLinkSuccess(LinkGoogleAccountResult result)
{
Debug.Log(“Google account successfully linked to PlayFab account!”);
AuthStatus.text = “Authenticated with Google”;
Popup.Show(“Google account successfully linked!”);
}
private void OnPlayFabError(PlayFabError error)
{
Debug.LogError("PlayFab Error: " + error.GenerateErrorReport());
AuthStatus.text = error.GenerateErrorReport();
Popup.Show(error.GenerateErrorReport());
if (error.Error == PlayFabErrorCode.LinkedAccountAlreadyClaimed)
{
Debug.LogError(“This Google account is already linked to another PlayFab account.”);
Popup.Show(“This Google account is already linked to another PlayFab account.”);
}
else
{
Popup.Show("Error: " + error.GenerateErrorReport());
}
}
#endregion
}
These are the android logcat erros:
- 2025.09.11 21:30:02.137 6627 6691 Error Unity Autentification Google Play Games failed. Status: Canceled
- 2025.09.11 21:30:02.137 6627 6691 Error Unity GooglePlayFabAuth:b__2_0(SignInStatus)
- 2025.09.11 21:30:02.137 6627 6691 Error Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
I’m trying to make Google Sign-In work. I’ve tested the app on Play Console (closed testing). The APIs are from Play Console (Client ID and resource), and OAuth is already configured there. I’ve also created the Google Cloud project and linked it with the Play Console app. I’m stuck at the Google Sign-In status: Canceled.