I've set up Google OAuth on the web before, and it was easy. Create a client ID, add your site's origin, done. So when I wrapped SportScore (a Next.js app) in Capacitor for Android, I expected sign-in to carry over.
It didn't. On the website it worked. In the app it failed with:
Google sign in failed [16] account reauth failed
I spent almost two weeks on it.
The Play Console maze
Before the bug even mattered, getting the app onto Google Play was confusing in its own right. As I understood it, you create the app in Play Console, work through a long list of setup tasks, build the app, then upload the .aab to a release track. The console tells you what to fill in, but not why it matters or what happens if you get it wrong. Here's what I wish it had said.
Privacy policy. A public URL describing what data your app collects. Most apps need one to publish. If it doesn't match what the app really does, you risk rejection.
App access. Tells reviewers how to get past a login wall. If parts of your app need sign-in, give them a test account. If you don't, they can't reach those screens and review can stall.
Ads declaration. Whether your app shows ads. Mine uses AdMob, so the answer is yes. Saying no while showing ads is a policy violation.
Content rating. A questionnaire that produces age ratings. You can't publish without one, and wrong answers can get the rating revoked later.
Target audience. The age groups your app is for. Picking under-13 puts you under the much stricter Families policies, so choose deliberately.
Data safety. The one that confused me most. It's a form listing what user data you collect, share and protect, and it has to match reality. My app uses Google sign-in, the camera and microphone for recording matches with a live score overlay, and location for finding nearby events, so all of those need declaring. Mismatches are a common reason for rejection.
Store listing. Name, description, icon and screenshots. Incomplete listings block the production release.
App signing. This one ties back to the bug. With Play App Signing, Google re-signs your app with its own key. So the SHA-1 that Google Sign-In sees on a Play-installed device is Play's key, not your upload key. You find it under App integrity in Play Console.
Play's exact rules change over time, so check the help text in your own console.
What I checked, and none of it was the problem
- The Web client ID in my env file. It was correct, because web sign-in worked with it.
- The OAuth consent screen and test users.
- The plugin config in code.
- The Digital Asset Links file. It looks relevant because it also holds your signing fingerprint, but it only controls App Links, not sign-in.
What I missed
Web and Android authenticate differently, and each needs its own OAuth client in Google Cloud.
- Web: Google checks the Authorized JavaScript origins on your Web client.
- Android: Google's Credential Manager checks your package name + signing certificate SHA-1 against an Android OAuth client in the same project. If none matches, you get error 16.
I only had the Web client. I never created an Android one, so Google had nothing to match my app against.
To be fair to Google, this is documented. But it's spread across the Cloud Console, the Android and Credential Manager docs, and Play Console, and no single page says "your web setup and your Android setup are two different things." I searched for a long time because each piece made sense alone but didn't tell me which one I was missing.
The fix
- In Google Cloud Console, in the same project as your Web client, create an OAuth client of type Android.
- Enter your package name (for me,
com.humfurie.sportscore). - Enter the SHA-1 of the key your installed app is signed with.
- Wait a few minutes, close the app fully, and try again.
You don't put the Android client ID anywhere in your code. Your app keeps passing the Web client ID, and Google matches the Android client by package and SHA-1 on its side.
Which SHA-1?
If you publish through Google Play with Play App Signing, Play re-signs your app with its own key. The device then sees that key's SHA-1, not the one from your upload keystore.
- Installed from Play: register the app signing key SHA-1.
- Sideloaded release build: register your upload key SHA-1.
- Debug builds: register the debug keystore's SHA-1.
Registering all of them is harmless.
Takeaways
- "It works on web" tells you nothing about Android. They're separate setups in the same Google Cloud project.
- Error 16 with Credential Manager usually means the package + SHA-1 pair isn't registered.
- Play Console asks for a lot of information. Knowing what each field is for makes it much less scary.
- The answer was in the docs, but scattered and hard to connect. If you're stuck on auth for a new platform, search for that platform's client type specifically ("Android OAuth client", "SHA-1"), not just the error message.