Execution failed for task ':app:packageRelease'.
Failed to read key my-key-alias from store
"/Users/MichaelLeung/GHRepos/MyApp/android/app/my-release-
key.keystore": Keystore was tampered with, or password was incorrect
I'm positive my password is correct; I've gone through the steps that Facebook lists on the React Native docs multiple times.
So if you were trying to generate a signed APK and used a no ASCII letter, you'd probably get this error.
Execution failed for task ':app:packageRelease'.
com.android.ide.common.signing.KeytoolException: Failed to read key my-key-alias from store "/Users/.../.../.../android/app/my-release-key.keystore": keystore password was incorrect
I couldn't find a way to reset the old password.
Thankfully there is a work around, using the Android Studio.
First I had to remove all the code from gradle.properties and build.gradle, (that I had to add according to the docs..
This solution is from a a comment here: Keystore password was incorrect "I am facing the same issue. Using Build -> Generate Signed APK in android studio works, but putting the config in build.gradle doesn't."
Then use the "signing/keytool UI that's part of Android Studio", which can be found in Build -> Generate Signed Bundle/APK ...
There you can create a new key store password and a key password WHICH HAVE TO BE THE SAME!!!
Note after finishing, Android Studio saves the app-release.apk file in android -> app -> release.
Happy coding :)
I had the same problem. After hard coded the settings in the build.gradle, instead off set it in the gradle.properties, is was working.
signingConfigs {
release {
//if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file("key.keystore")
storePassword "****"
keyAlias "myKey"
keyPassword "****"
// }
}
}
After further testing with java.lang.System.console(MYAPP_RELEASE_STORE_PASSWORD) I saw that there was a space after my password.
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
java.lang.System.console(MYAPP_RELEASE_STORE_PASSWORD)
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
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