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

64,830

Solution 1

Apparently I just found another post posted few months ago that solved my issues I struggled for days...

Simply need to change the keystore and key alias password to be the same for it to work. Though I still don't know why the same keystore worked before when I was publishing updates; then not working anymore until I changed the passwords.

If anyone has answer for that, please let everyone know!

Solution 2

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.

Solution 3

Apparently Google decided to set the default keystore password to be android.

The keytool utility prompts you to enter a password for the keystore. The default password for the debug keystore is android. The keytool then prints the fingerprint to the terminal.

See https://developers.google.com/android/guides/client-auth

Solution 4

I've just had the same problem, and I am 100% sure of my password. I found the solution directly by adding -storepass in the command line. Using this command did the trick:

keytool -list -v -keystore C:\....\keystore.jks -storepass HereMyPassword -alias HereMyAlias

Solution 5

In my case, I was copying and pasting the keystore and key passwords from Evernote and Android Studio wasn't handling it correctly. After typing the passwords manually, I was able to generate the APK.

Share:
64,830
Lancelot
Author by

Lancelot

Updated on November 19, 2021

Comments

  • Lancelot
    Lancelot over 2 years

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

  • user207421
    user207421 over 8 years
    You're better off without key alias passwords altogether. Java does not support them very well at all.
  • Someone Somewhere
    Someone Somewhere about 8 years
    I've seen other posts where devs have said that Gradle 1.3.1 works. It appears that since then, Gradle has been broken. There's two issues outstanding (4 MONTHS OLD NOW!): code.google.com/p/android/issues/detail?id=188574 and code.google.com/p/android/issues/detail?id=187532
  • Admin
    Admin about 8 years
    is a nonense, if you change, alias and key, you will get a duplicates in google play ! and you can't overwrite your old app
  • Ronen Festinger
    Ronen Festinger about 7 years
    Yep, that was it, i forgot it.
  • Alon Kogan
    Alon Kogan over 6 years
    For me it appears that the only thing that was wrong is the key alias value. so keytool -list -v -keystore myFile.jks -storepass 'somePassword' worked since I was able to see the key alias
  • tanni tanna
    tanni tanna about 6 years
    I was struggling with the same issue, what I was doing wrong was passing Store password to Key word, and Key Password to Store password. This explains why using same password works.
  • finalpets
    finalpets about 5 years
    Thanks works!! save my life, same here android studio 3.3.1
  • Md Sadab Wasim
    Md Sadab Wasim over 4 years
    Work in flutter projects too, just go for flutter clean.
  • MarkWalczak
    MarkWalczak over 3 years
    Could you give me the path to the keystore.properties please...
  • Samuel T. Chou
    Samuel T. Chou almost 3 years
    That's why I thought Android is dirty -- we have to "clean" it more often than we wanted.
  • sj_959
    sj_959 over 2 years
    How did you open executionHistory.bin?
  • Satyajit
    Satyajit over 2 years
    This worked for me.
  • gumuruh
    gumuruh about 2 years
    i tried to build and clean but still having those errors...
  • Pulkit Prajapat
    Pulkit Prajapat almost 2 years
    this one worked for me.