已通过Google Play Signing签名的安卓游戏本地签名测试问题
Alright, let's work through this together—this is a super common gotcha when combining Google Play App Signing with Play Games Services, so I’ve got a clear set of steps to get your testing working:
The core issue here is almost always a mismatch between the SHA fingerprints of your local debug/release builds and the ones Google Play Games Services recognizes. Since you’re using Google Play App Signing, there are two key certificates to track:
- App Signing Certificate: The one Google Play uses to sign your final public builds.
- Upload Certificate: The one you use to sign APKs/AABs before uploading to Play Console.
Here’s what to do:
- Head to Google Play Console → Your App → App integrity → App signing. Copy the SHA-1 and SHA-256 fingerprints for both the App Signing and Upload certificates.
- For your debug build:
Generate the fingerprint of your local debug keystore (usually at~/.android/debug.keystore) with this command:
Compare this fingerprint to the ones in Play Console. If it’s missing, add it to your Play Games Services linked app config (more on that next).keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android - For your release build: Use the Upload Certificate fingerprint you copied earlier—this is what your local signed release build uses, so Play Games needs to recognize it.
Make sure your app’s Play Games setup knows about all relevant fingerprints:
- Go to Play Console → Grow → Play Games Services → Setup and management → Linked apps.
- Select your app, then click Add fingerprint and paste all the SHA-1/SHA-256 values you collected (debug, upload, and app signing certificates).
- Critical step: Re-download the
google-services.jsonfile from this page and replace the one in your Android project’sapp/directory. This file needs to reflect the new fingerprints for your app to authenticate correctly.
Double-check your module-level build.gradle file to ensure your debug and release builds are using the correct keystores:
android { signingConfigs { debug { storeFile file("~/.android/debug.keystore") storePassword "android" keyAlias "androiddebugkey" keyPassword "android" } release { storeFile file("your-upload-keystore.jks") // Path to your upload keystore storePassword "your-store-password" keyAlias "your-key-alias" keyPassword "your-key-password" } } buildTypes { debug { signingConfig signingConfigs.debug // Other debug configs... } release { signingConfig signingConfigs.release // Other release configs... } } }
Sync your project after making these changes to ensure the configs take effect.
If your local release build still won’t authenticate, use Google Play’s Internal App Sharing to mimic the production signing flow:
- Upload your locally signed release APK/AAB to Play Console → Testing → Internal app sharing.
- Send the test link to your registered testing account, install the app from that link. This build will use the same signing chain as your public Beta, so Play Games Services should recognize it.
- Make sure your test account is added to Internal testing or Closed testing in Play Console and has accepted the test invitation.
Last but not least:
- Add your testing Google account to Play Console → Play Games Services → Testing → Test accounts. This ensures the account has access to your unpublished Play Games features.
- On your test device, make sure you’re signed into the Google Play Games app with the same test account, and that the app is up to date.
内容的提问来源于stack exchange,提问作者Julian

