Fix Unity Google Play Games Leaderboard Not Showing
Troubleshoot Unity Google Play Games leaderboards: verify leaderboard ID, publish Play Games config, match SHA1/OAuth, initialize PlayGamesPlatform, enable debug logs.
Unity Google Play Games Leaderboard Not Showing Despite Successful Login
I’ve integrated Google Play Services into my Unity project using the Google Play Games plugin. The authentication/login works correctly and displays the sign-in status, but calling ShowLeaderboardUI does not display the leaderboard. There are no error codes in Logcat. I’ve tested this by uploading the app to the Google Play Store and downloading/installing it from there.
Here’s the relevant code from my GooglePlay_Handler script:
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using TMPro;
public class GooglePlay_Handler : MonoBehaviour
{
public TMP_Text logintext;
public void SignIn()
{
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status)
{
if (status == SignInStatus.Success)
{
// Successfully logged in.
}
else
{
// Login failed.
}
}
public void ShowLeaderboard()
{
PlayGamesPlatform.Instance.ShowLeaderboardUI("MyLeaderboardID");
}
public void ReportScore(int score)
{
PlayGamesPlatform.Instance.ReportScore(score, "MyLeaderboardID", (bool success) => { });
}
}
Another script calls the ShowLeaderboard() function. What could be causing the leaderboard UI not to appear? How can I troubleshoot or fix Google Play Games leaderboard issues in Unity?
If your Unity Google Play Games leaderboard isn’t appearing despite solid authentication in google play unity setups, the culprit is usually an unpublished leaderboard in the Play Console, mismatched SHA1 fingerprints for OAuth, or skipped plugin initialization steps. You’ve nailed the login and even tested via Play Store install—that rules out basic dev build glitches—but double-check if “MyLeaderboardID” matches exactly (case-sensitive) and if the leaderboard’s published for testing. Start with enabling debug logs; they’ll reveal silent failures like invalid IDs or auth scopes that Logcat might miss otherwise.
Contents
- Symptoms of ShowLeaderboardUI Not Working
- Quick Fixes for Google Play Unity Leaderboards
- Play Console Setup for Leaderboards
- Unity Plugin Configuration for Google Play Games
- Release Build Fixes in Google Play Unity
- Debugging Leaderboard Issues Step-by-Step
- Sources
- Conclusion
Symptoms of ShowLeaderboardUI Not Working
Picture this: login succeeds, Social.localUser.id spits out a valid player ID, but PlayGamesPlatform.Instance.ShowLeaderboardUI("MyLeaderboardID")? Crickets. No UI pops up, no crash, just nothing. You’re not alone—GitHub issues for the official plugin are littered with this exact scenario, especially after ReportScore calls or in store-downloaded APKs.
Why does it ghost you? Common triggers include:
- Leaderboard exists but isn’t published in Play Console (stuck in testing mode).
- Exact ID mismatch—IDs are alphanumeric hashes like “CgkI…_QA”, not friendly names.
- Plugin not fully initialized, so
ShowLeaderboardUIsilently bails. - Release signing mismatches nuking auth scopes.
In your code, ShowLeaderboard() looks solid at first glance, but without PlayGamesPlatform.InitializeInstance beforehand? That’s a red flag. Users report the UI “hangs” post-score submit because the plugin expects full setup.
Quick Fixes for Google Play Unity Leaderboards
Before diving deep, knock out these 5-minute checks—they fix 70% of google play games unity leaderboard woes.
-
Verify Leaderboard ID: Log into Google Play Console, go to Play Games Services > Leaderboards. Copy the Leaderboard ID (not display name). Paste exactly into your code. Typo? No UI.
-
Publish the Leaderboard: In the same screen, hit “Publish” next to your leaderboard. Testing-only configs won’t show for real users, even signed-in ones.
-
Test Re-Auth: Force logout then re-login:
PlayGamesPlatform.Instance.SignOut(); PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
Clears cached bad state.
-
Swap to All Leaderboards UI: Temporarily call
PlayGamesPlatform.Instance.ShowLeaderboardUI();(no ID). If that works, your ID’s busted. -
Check Player Profile: In Play Games app, ensure “Let others see your game activity” is toggled on under settings.
Tried these? Still blank? Time for Console deep-dive.
Play Console Setup for Leaderboards
Here’s where most google play unity headaches start: config mismatches. Since you’re testing via Play Store download, App Signing is likely the villain—Google re-signs your APK with their key, invalidating your upload-time SHA1.
Step-by-Step Fix:
-
Head to Play Console > Your App > Setup > App Integrity. Copy the App signing key certificate SHA1 (not upload key).
-
Jump to Google Cloud Console. Delete old OAuth 2.0 clients for your game.
-
Create new Android OAuth client:
- Package name: your app’s.
- SHA1: the App Signing one from above.
Download theclient_secrets.jsonif needed, but mainly link it back.
- In Play Console > Play Games Services > Configuration, ensure your app’s linked and published.
Users on Stack Overflow fixed identical “success but no update/UI” by this exact SHA1 swap—your store test screams this issue.
Also, confirm the leaderboard’s under the right Application tab, not buried in testing.
Unity Plugin Configuration for Google Play Games
Your GooglePlay_Handler skips a crucial step: full plugin bootstrap. The official Android Developers guide mandates InitializeInstance before auth or UI calls.
Updated Code Template (drop this in Awake/Start):
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
public class GooglePlay_Handler : MonoBehaviour
{
void Start()
{
var config = new PlayGamesClientConfiguration.Builder()
.EnableSavedGames()
.RequestServerAuthCode(false)
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate(); // Critical!
PlayGamesPlatform.DebugLogEnabled = true; // For logs
}
public void SignIn()
{
PlayGamesPlatform.Instance.Authenticate((SignInStatus status) => {
ProcessAuthentication(status);
});
}
// Your existing ProcessAuthentication, ShowLeaderboard, ReportScore...
}
Key gotchas:
- Call
Activate()post-config. - Edit
Assets/Plugins/Android/games-ids.xml(auto-generated by plugin): Paste your Resources ID from Play Console. - Plugin version? Grab latest from GitHub repo—bugs like #2045 fixed post-0.11.
Rebuild, test. UI should flicker open.
Release Build Fixes in Google Play Unity
Store APKs hit different snags. ProGuard/R8 mangles plugin classes, killing leaderboards despite login.
ProGuard Rules (add to Assets/Plugins/Android/proguard-user.txt):
-keep class com.google.android.gms.** { *; }
-keep class com.google.games.** { *; }
-dontwarn com.google.android.gms.**
In Player Settings:
- Publishing Settings > Minify > Release: Add custom ProGuard file.
- Target API: 33+ (plugin compatibility).
Gradle template issues? Ensure mainTemplate.gradle has Google Services plugin:
apply plugin: 'com.google.gms.google-services'
Users in GitHub #1970 report zero features (auth/leaderboards) without this. Internal testing tracks (not production) sidestep signing woes too.
Debugging Steps Step-by-Step
No Logcat errors? Dig deeper.
- Enable Verbose Logs:
PlayGamesPlatform.DebugLogEnabled = true;
Filter Logcat: GPG or PlayGames. Look for “Leaderboard not found” or scope errors.
- Score Callback Deep-Dive:
Log inReportScore:
PlayGamesPlatform.Instance.ReportScore(score, "MyLeaderboardID", (success) => {
Debug.Log($"Score report: {success}");
if (success) ShowLeaderboard(); // Chain carefully
});
-
Clear App Data: Uninstall, clear Play Games cache, reinstall. Forces fresh auth.
-
Custom Leaderboard Load:
PlayGamesPlatform.Instance.Leaderboards.GetLeaderboard("MyLeaderboardID", LeaderboardTimeSpan.Daily, LeaderboardCollection.Public,
(Leaderboard ldb) => {
if (ldb == null) Debug.LogError("Leaderboard null!");
else Debug.Log($"Loaded: {ldb.Scores.Length} scores");
});
Null? Config fail.
- Plugin Issues Check: GitHub #1914/#2859 mirror your symptoms—update plugin, test on emulator with GPGS 22.XX.X.
Stuck? Post logs to plugin issues with Unity version, plugin version, Logcat snippet.
Sources
- Leaderboards in Unity games - Android Developers
- Google Play Leaderboard UI Not Loading after posting score · Issue #2045
- Google Play Games Sign-In and Leaderboard Issue · Issue #1970
- Google Play Leaderboard not showing up after trying to post score · Issue #1135
- ShowLeaderboardUI not showing at all · Issue #1914
- Google Play Services Unity Plugin not Show Leaderboard - Stack Overflow
- Google Play leaderboards not updating after new score - Stack Overflow
- GitHub - playgameservices/play-games-plugin-for-unity
Conclusion
Google play games unity leaderboards flake out from config oversights more than code bugs—nail the Play Console publish, SHA1 OAuth match, and InitializeInstance/Activate sequence, and ShowLeaderboardUI will fire reliably. You’ve got the foundation; these tweaks (especially signing keys for store tests) should unblock you fast. Test iteratively with debug logs on, and if scores post but UI lags, chain the calls post-success callback. Drop a comment with your logs if it persists—community fixes evolve quick.