keytool -genkey error: Keystore file does not exist

Run command prompt as Administrator and it will be done.


Generating a key pair (and a new keystore) has to be done as a separate operation to creating a self-signed certificate for that key.

i.e.

keytool -genkey -alias myKey -keystore store.jks
keytool -selfcert -alias myKey -keystore store.jks

First generate the upload key using below command:

keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

then run

keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v