Expo build:android failed in task :app:packageRelease

Cross posting from https://forums.expo.dev/t/build-android-failed-in-task-packagerelease-attempting-to-build-64-bit-bundle-using-new-keys-generated-by-expo-opt-in-google-play-signing-process

This was such a stupid process. We went through the whole expo opt-in-google-play-signing process and thankfully we thought to hang onto the .jks.bak file and the details that Expo spat out when opting into Google Play signing. Expo suggested that it should delete the cert from their servers given that I’d confirmed that Google Play signing was turned on.

Then we ran into the exact issue above. Builds were failing because Expo couldn’t find the cert. Derp. So we ran expo build:android --clear-credentials -t app-bundle just to get builds working again. We let Expo generate its own cert because we didn’t think it mattered. When we tried to push this to Google Play we got the error:

[!] Google Api Error: apkNotificationMessageKeyBundleSignedWithWrongKey: The Android App Bundle was signed with the wrong key. Found: SHA1: 43:4A:06:DB:…, expected: SHA1: CA:94:83:B8:…

So we ran keytool -list -v -keystore app_sign.jks.bak -alias QGNoYXJnZWZ to check the fingerprint of the .jks.bak file that Expo spat out. Lo and behold it’s the exact cert that we still need to be signing our builds with.

So we ran another build with --clear-credentials and uploaded that cert back to Expo’s servers and everything works again now.

Hang onto that backup keystore!