Mobile Dev

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.

1 answer 1 view

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:

csharp
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

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 ShowLeaderboardUI silently 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.

  1. 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.

  2. 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.

  3. Test Re-Auth: Force logout then re-login:

csharp
PlayGamesPlatform.Instance.SignOut();
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);

Clears cached bad state.

  1. Swap to All Leaderboards UI: Temporarily call PlayGamesPlatform.Instance.ShowLeaderboardUI(); (no ID). If that works, your ID’s busted.

  2. 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:

  1. Head to Play Console > Your App > Setup > App Integrity. Copy the App signing key certificate SHA1 (not upload key).

  2. Jump to Google Cloud Console. Delete old OAuth 2.0 clients for your game.

  3. Create new Android OAuth client:

  • Package name: your app’s.
  • SHA1: the App Signing one from above.
    Download the client_secrets.json if needed, but mainly link it back.
  1. 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):

csharp
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:

gradle
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.

  1. Enable Verbose Logs:
csharp
PlayGamesPlatform.DebugLogEnabled = true;

Filter Logcat: GPG or PlayGames. Look for “Leaderboard not found” or scope errors.

  1. Score Callback Deep-Dive:
    Log in ReportScore:
csharp
PlayGamesPlatform.Instance.ReportScore(score, "MyLeaderboardID", (success) => {
Debug.Log($"Score report: {success}");
if (success) ShowLeaderboard(); // Chain carefully
});
  1. Clear App Data: Uninstall, clear Play Games cache, reinstall. Forces fresh auth.

  2. Custom Leaderboard Load:

csharp
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.

  1. 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

  1. Leaderboards in Unity games - Android Developers
  2. Google Play Leaderboard UI Not Loading after posting score · Issue #2045
  3. Google Play Games Sign-In and Leaderboard Issue · Issue #1970
  4. Google Play Leaderboard not showing up after trying to post score · Issue #1135
  5. ShowLeaderboardUI not showing at all · Issue #1914
  6. Google Play Services Unity Plugin not Show Leaderboard - Stack Overflow
  7. Google Play leaderboards not updating after new score - Stack Overflow
  8. 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.

Authors
Verified by moderation
Moderation
Fix Unity Google Play Games Leaderboard Not Showing