Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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??

like image 700
Lancelot Avatar asked Oct 07 '15 08:10

Lancelot


1 Answers

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.

like image 77
Arnulfo B. Bataller Avatar answered Sep 19 '22 19:09

Arnulfo B. Bataller