Boolean Build

Your release AAB was signed with the debug key

The build reported success. The upload was rejected with signed with the wrong key. Both are true, and the cause is a default in the React Native Android template that quietly substitutes the debug keystore when nothing else is configured.

The fallback

The generated build.gradle decides signing with a ternary:

signingConfig = (System.getenv("MYAPP_RELEASE_STORE_FILE") != null)
    ? signingConfigs.release
    : signingConfigs.debug

Build on a machine where that variable is not exported — a fresh laptop, a CI runner, a shell that never sourced your env file — and Gradle produces a perfectly valid, perfectly uploadable bundle signed with the debug key. For a managed Expo project it is worse: expo prebuild regenerates android/ and can restore that fallback after you fixed it.

How it surfaces

Late, and at upload rather than build:

403 The Android App Bundle was signed with the wrong key.
    Found:    SHA1: 5E:8F:16:06:2E:A3:CD:...
    Expected: SHA1: 37:8B:F7:C2:64:10:5A:58:...

Every fingerprint in that message is a real key: the app signing key Google holds, the upload key Play expects, and whatever your machine just used. Only one may sign an upload.

Fail at build time instead

Read signing from a file and throw when it is absent. No env vars, no ternary, no debug fallback:

signingConfigs {
    release {
        def ks = new Properties()
        def f = rootProject.file("keystore.properties")
        if (!f.exists()) {
            throw new GradleException("Release signing not configured: add android/keystore.properties")
        }
        ks.load(new FileInputStream(f))
        storeFile file(ks.getProperty("storeFile"))
        storePassword ks.getProperty("storePassword")
        keyAlias ks.getProperty("keyAlias")
        keyPassword ks.getProperty("keyPassword")
    }
}
buildTypes { release { signingConfig signingConfigs.release } }

With that in place the build fails in seventeen seconds with a sentence that says what to do, instead of succeeding and failing an upload an hour later.

Verify before uploading

keytool -printcert -jarfile app-release.aab | grep SHA1

Compare against App integrity → Upload key certificate in Play Console. If they differ, stop — Play accepts the bytes, then rejects the bundle, and on a large AAB that is a slow round-trip.

When the key itself is lost

A certificate cannot sign anything; it only verifies. If the upload key's password is gone, the certificate on Play tells you what you are missing but cannot help you produce it. Use App integrity → Request upload key reset, generate a fresh keystore whose password you record, and upload its exported certificate.

Two things about that flow: Google enforces a hold period — 48 hours in our case — and until it expires every upload fails with “The upload certificate this APK is signed with is not yet valid because it has been recently reset.” That message means wait, not retry differently. And the reset replaces only the upload key; the app signing key stays with Google, so installs are unaffected.

Related: the draft-app 400 that also bites a first Play release, and the pre-upload checklist.