How do I sign my android app bundle with the correct signing key?
Answers related to “Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again” first, you need to generate a signing key using keytool and create keystore file for your project.
Open you React Native's project android folder. Go to Build -> Generate Signed Bundle / APK. Select Android App Bundle. Enter your key-store details (if this is your first time doing this, you have to check the Export encrypted key checkbox, which you can use for Google Play App signing) and click Next.
In the menu bar, click Build > Generate Signed Bundle/APK. In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next. Below the field for Key store path, click Create new. On the New Key Store window, provide the following information for your keystore and key, as shown in figure 2.
You can't change the key you used to sign any previous versions - Google Play will reject any uploads which aren't signed with the same key. Just increment the version number and sign with the same key and upload it.
The error suggests that you have uploaded an APK or an App Bundle previously. All the artifacts you upload to the Play Console should all be signed with the same keystore. So the error means that you signed the App Bundle with a key that is different than the ones you have uploaded previously. You have to either find that keystore you used before or reset the key by contacting Play Console support team.
I tried using the multiple answers here & in this question, but somehow I was getting this error because I had some issues with my android/app/build.gradle
and android/gradle.properties
files.
Two things you should check (in addition to the other solutions here) are:
android/gradle.properties
and android/app/build.gradle
, make sure your keystore
variables match exactly. android/gradle.properties
, you probably have something like this: MYAPP_RELEASE_STORE_FILE=<> MYAPP_RELEASE_KEY_ALIAS=<> MYAPP_RELEASE_STORE_PASSWORD=<> MYAPP_RELEASE_KEY_PASSWORD=<>
android/app/build.gradle
: android { ... signingConfigs { release { if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } } }
android/app/build.gradle
, make sure you set signingConfig
to signingConfigs.release
in your release
buildTypes
: android { ... buildTypes { debug ... release { signingConfig signingConfigs.release } } }
I was banging my head on the table over this for about two hours. When I finally gave up and was filling out my "reset key" request, I realized that I was currently attempting to upload it to the wrong project the whole time.
So, step one: confirm that you're attempting to upload to the correct project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With