Unable to upload android bundle to Google Play with Google Play app signing via fastlane

Viewed 1951

We have a few apps published in Google Play, all are signed with same keystore. Last year we switched to app bundles, enabled signing by Google Play. Everything works fine when signing and uploading bundle manually. Although when I tried uploading bundle to Google Play via fastlane it gives me an error:

Google Api Error: apkNotificationMessageKeyBundleSignedWithWrongKey: The Android App Bundle was signed with the wrong key. Found: SHA1:...., expected: SHA1:......

If I upload same .aab manually, everything is fine. What should I do? I suppose something from Google Play signing. I don't want to break anything since I'm only a developer and not account owner. Can I generate new keystore without breaking existing?

Edit: on App Signing tab in Google console I can download upload_cert.der and deployment_cert.der

3 Answers

The verification of the signing key via the API or via the Play Console UI is the same, so you are likely not uploading the same file manually and via fastlane.

Make sure that the same keystore file (and same key alias) is used to sign the App Bundle in fastlane.

I realized that I didn't specify package_name parameter in fastlane supply command so it tried to upload bundle to a wrong app. Silly me.

For those who might be interested I contacted Google Support with this question and they suggested me to reset key for an app. But it wasn't necessary after all

you can’t recover your lost keystore but you can replace keystore on playstore, you just need to enable google play app signing on play store console You can Replace new Keystore certification on play store. than you can update your app,No need to Remove Your app from play Store You can Update Your app. it’s Possible now, After May 2017 you can Update your app if you lost your keystore or keystore password. you can update your app using new Keystore file please refer this blog

https://support.google.com/googleplay/android-developer/answer/7384423?hl=en

  1. Follow the instructions in the Android Studio Help Center to generate a new key. It must be different from any previous keys. Alternatively, you can use the following command line to generate a new key: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks This key must be a 2048 bit RSA key and have 25-year validity.

2.Export the certificate for that key to PEM format: keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

3.Reply to this email and attach the upload_certificate.pem file.

Related