Google Sign-In may work in an app installed directly from Android Studio but fail in a closed-test or production build installed from Google Play.
Common symptoms include:
- Returning to the original screen after selecting a Google account
DEVELOPER_ERRORor error code 10- No user appearing in Firebase Authentication
- Failure to obtain an ID token only in an internal-test or production build
The most common cause is that the SHA fingerprint of the app signing key used by Google Play for the distributed build has not been registered in Firebase or Google Cloud.
Why does the debug build work?
Google Sign-In identifies an Android app through a combination of values such as:
- Package name
- Signing certificate
- SHA-1 or SHA-256 fingerprint
- OAuth client
- Firebase or Google Cloud project
An Android Studio debug build is normally signed with debug.keystore. An APK distributed by Google Play is signed with the app signing key managed through Play App Signing.
Even with the same package name, the signing certificates differ. Registering only the debug SHA can therefore make authentication work locally while the Google Play build fails.
Distinguish the upload key from the app signing key
Play App Signing uses two important keys:
| Key | Main purpose |
|---|---|
| Upload key | Signs the AAB submitted by the developer to Play Console |
| App signing key | Signs the APKs Google Play distributes to users |
For authentication in the Google Play build, the certificate that normally matters is the app signing key certificate.
Do not copy the upload-key fingerprint when the Firebase configuration requires the certificate of the installed Play-distributed app. For more detail, see Play App Signing and Upload Keys Explained.
Fastest fix sequence
- Open the target app in Play Console
- Open the Play App Signing or app-integrity page
- Copy the SHA-1 from the app signing key certificate
- Copy SHA-256 as well when required by the feature
- Add the fingerprints to the correct Android app in Firebase
- Enable the Google provider in Firebase Authentication
- Review the OAuth clients in Google Cloud
- Download the latest
google-services.json - Increase
versionCodeand publish a new AAB - Update the app from Google Play and test again
Add the SHA fingerprint to Firebase
In Firebase Console:
- Open the correct project
- Open Project settings
- Go to General and Your apps
- Select the Android app
- Choose Add fingerprint
- Save the SHA copied from Play Console
SHA-1 is especially important for Google Sign-In. SHA-256 may be required for Firebase App Check, Play Integrity, Android App Links, or other APIs, so follow the official setup instructions for the features you use.
The same Android app entry can contain fingerprints for debug, local release, and Google Play app-signing certificates.
Confirm the package name
The package registered in Firebase must match the actual applicationId of the Google Play build.
android {
defaultConfig {
applicationId = "com.example.app"
}
}
A product flavor can change the final package name:
productFlavors {
create("development") {
applicationIdSuffix = ".dev"
}
}
In this example, the development build is com.example.app.dev, while production is com.example.app.
Check the production package submitted to Google Play, not the package used by a local development flavor.
Android client ID versus web client ID
Google Sign-In commonly involves two OAuth client types that serve different purposes.
Android client ID
An Android OAuth client identifies the app through its package name and SHA-1 certificate fingerprint.
Web client ID
A web OAuth client is commonly used as the ID-token audience or server client ID. With Credential Manager, setServerClientId normally receives the web client ID.
val googleIdOption = GetGoogleIdOption.Builder()
.setFilterByAuthorizedAccounts(false)
.setServerClientId(WEB_CLIENT_ID)
.build()
Using an Android client ID in this field can produce an audience or configuration mismatch.
Review the client type in Google Cloud Console instead of selecting an ID only because its name looks familiar.
Update google-services.json
After adding SHA fingerprints or changing Google Sign-In configuration, download the latest google-services.json from Firebase.
The standard Android location is:
app/google-services.json
Flutter and React Native normally use:
android/app/google-services.json
Confirm that the file belongs to the intended Firebase project and Android app by checking both project_id and package_name. See What Is google-services.json? for a complete configuration checklist.
When only the backend returns 401
If account selection succeeds but the backend rejects the token with HTTP 401, inspect the ID token’s aud claim.
Compare:
- The web client ID used by the app
- The web OAuth client ID in Google Cloud
- The audience or client IDs accepted by the backend
When these do not match, the Google account flow can complete while server-side token verification fails.
Do not disable audience verification merely to make the request pass. Correct the client configuration on the app and backend.
Test each distribution type separately
After the fix, distinguish these builds:
| Build | Typical signing certificate |
|---|---|
| Android Studio debug build | Debug keystore |
| Locally distributed release APK | Local release or upload key |
| Google Play distributed build | Play App Signing app signing key |
When testing the Google Play build, make sure the device is running the version installed or updated through Google Play, not an older locally installed APK with the same package name.
If a differently signed local build remains installed, uninstall it only after confirming that losing local app data is acceptable.
Additional checks when the SHA is already registered
If the app signing SHA-1 is already present, verify:
- The fingerprint was added to the correct Firebase Android app
- The Firebase project matches the one used by the app
- The Google provider is enabled
- The current
google-services.jsoncontains the correct client configuration - The server client ID is a web client ID
- The backend accepts that web client ID as an audience
- The published AAB has a higher unused
versionCode - The tester actually received the latest release
A matching SHA cannot compensate for a wrong package name, wrong Firebase project, or wrong OAuth audience.
Summary
When Google Sign-In fails only in the Google Play build, check these items in order:
- App signing key SHA-1 in Play Console
- The Android app entry in Firebase
- Package name
- Google provider status
- Android OAuth client
- Web client ID
- Latest
google-services.json - Latest AAB and
versionCode
Start by confirming that Firebase contains the SHA of the app signing key, not only the upload key or debug key. For a comparison of all certificate types, see Add SHA-1 and SHA-256 for Debug, Release, and Google Play.
Primary sources
Official references
- Firebase Authentication: Authenticate with Google on Android
- Google Play: Use Play App Signing
- Android Developers: Sign your app
Check the linked official documentation before a production release.
Continue reading
Related guides
TestCrew
Find testers through mutual testing
Test other Android apps, provide useful feedback, and use earned credits to recruit testers for your own Google Play closed test.
Learn how TestCrew works