0

I have faced a quite serious issue with my keystore and failed to resolve it.

I'm using:

-androind studio 3.0.1 
-gradle:3.0.1
-distributions/gradle-4.1-all.zip

and for some reason when I try to Build> Generate Signed Apk...

I'm getting

Error:Execution failed for task :app:packageProductionRelease. Failed to read key myKey from store "C:\Users\abc\Documents\bucket\mm\keystore": Keystore was tampered with, or password was incorrect

I've tried using terminal

keytool -list -v -keystore "keystore.jks" -alias myKey -storepass pass -keypass pass and it shows the key's properties. so Im pretty sure the password is correct and the keystore is not corrupted.

Is there an alternative way or a solution to resolve this issue ?

your help is much appreciated.

Poorya
  • 1,291
  • 6
  • 27
  • 57
  • Possible duplicate of https://stackoverflow.com/questions/16891182/keytool-error-keystore-was-tampered-with-or-password-was-incorrect – Jay Rathod Apr 04 '18 at 11:27
  • Possible duplicate of [AndroidDebugKey Keystore was tampered with, or password was incorrect](https://stackoverflow.com/questions/5771210/androiddebugkey-keystore-was-tampered-with-or-password-was-incorrect) – 2Dee Apr 04 '18 at 11:41
  • @2Dee we are using our own keystore and it's for release. It is not similar to what you suggest – Poorya Apr 04 '18 at 13:42
  • @Jay Rathod im using an existing keystore. So it is not similar to the SO post you are suggesting – Poorya Apr 04 '18 at 13:45

1 Answers1

0

In case anyone faces the similar issue. apparently there was genuinely an issue with the keystore. after replacing it with and old copy of the same keystore it worked.

Poorya
  • 1,291
  • 6
  • 27
  • 57
  • could you give more details? : ) – Sunshine Jul 17 '22 at 20:28
  • 1
    It's been a long time so I don't recall the details. but the conclusion was that the key was somehow corrupted. After replacing it using a copy of backup it resolved everything – Poorya Jul 18 '22 at 03:24