Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keytool error: java.security.UnrecoverableKeyException: Cannot recover key android

I can't signed my apk with the existing keystore. Its giving me this error when signing: com.android.ide.common.signing.KeytoolException: Failed to read key Cannot recover key

So, by following this link, I have tried to change the password but its giving me keytool error: java.security.UnrecoverableKeyException: Cannot recover key error when executing this command:

keytool -keypasswd -alias %MyKeyAlias% -new %newpassword% -keystore KeyStore.jks

I have already a version available in playstore using this keystore.

like image 422
0xAliHn Avatar asked Nov 20 '16 16:11

0xAliHn


1 Answers

I finally solved it by reading the document: https://www.rickyadams.com/wp/index.php/2017/11/15/keytool-java-keystore-ssl/

As I use a different storepass and keypass.

Verify the private key password by attempting to change it

> keytool -keypasswd -keystore KEYSTORE -alias ALIAS -storepass PASSWORD

This is the output you’ll see if a key password isn’t set, or if the key password is the same as the store password:

New key password for <ALIAS>:

This is the output you’ll see if a key password is set and you enter it incorrectly:

Enter key password for ALIAS:
keytool error: java.security.UnrecoverableKeyException: Cannot recover key

This is the output you’ll see if a key password is set and you enter it correctly:

Enter key password for <ALIAS>:
New key password for <ALIAS>:
like image 152
LingYan Meng Avatar answered Oct 27 '22 10:10

LingYan Meng