Search code examples
androidgradleandroid-keystoreapktool

Android Studio Generate Signed Failed to read key


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.


Solution

  • 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.