6

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.

Community
  • 1
  • 1
0xAliHn
  • 18,256
  • 21
  • 87
  • 110

2 Answers2

1

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>:
Folkmann
  • 5,691
  • 3
  • 12
  • 13
LingYan Meng
  • 609
  • 4
  • 10
0

Looks like missing private key.

Amit Bagga
  • 650
  • 3
  • 11