Android Studio - Keystore was tampered with, or password was incorrect

Lancelot picture Lancelot · Oct 7, 2015 · Viewed 53.4k times · Source

I am trying to generate a signed APK by using the built-in widget in Android Studio v1.4.

However, I got this annoying error

Error:Execution failed for task ':app:packageRelease'. Failed to read key cckey from store "C:\Users\Lancelot\Desktop\release.jks": Keystore was tampered with, or password was incorrect

I was able to retrieve my key alias like the below screenshot enter image description here

(In order to get to here, the key store password must be correct; otherwise it'll show error)

Then I typed in my key password but no luck on signing the APK... I even tried changing the key password using the command line keytool -keypasswd -alias cckey -keystore C:\Users\Lancelot\Desktop\release.jks. By running this I need to enter old password correctly before entering new password, which all went through; this proves that key password wasn't wrong at the first place.

So question is, if my key store password, key alias, and key password are all correct, what's wrong with it then??

Answer

Arnulfo B. Bataller picture Arnulfo B. Bataller · Feb 12, 2019

I had a similar problem while updating my app. The keytool was not reading the correct keystore file and instead pointing to an older keystore file that I created months ago and not used. Searched for some solutions online but didn't find one. Almost gave up but I thought about cleaning the project by clicking Build then Clean Project. This last resort worked for me.