How do I sign my android app bundle with the correct signing key?
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.
What I did was exclude my android files from git, then when I changed branch and rebuilt, my build.gradle file was overwritten.
React Native here!
I got this error after trying to upload the generated .aab file from the ./gradlew bundleRelease command. I fixed it by exporting the .aab file by using Android Studio again. I believe that this is the way to upload your first .aab file to Google Play anyway. In case you don't know how:
In Android Studio:
Now if you upload this .aab file, it should be accepted.
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 am using expo to build my app bundle. In my case, I had to:
expo fetch:android:keystore
keytool -h
to see the various commands available.expo ba -c
, took the manual route and when asked, I specified the keystore file I created in step 1.Just rebuild the project and generate signed apk once again and try !
Wasted my 2 days on this, had my keystore key but still showed error and request google for generating new key.... Read some random stackoverflow, where it was written to rebuild the project and try uploading once again.. IT WORKED !