Keystore file does not exist

I created a release key in the root directory of my ionic application using the command:

keytool -genkey -v -keystore android-release-key.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000

I can then successfully sign my app using:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore android-release-key.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk myapp

However, when I run:

keytool -v -list -keystore android-release-key.keystore

or

keytool -v -list -keystore android-release-key.keystore -alias myapp

I get the error:

keytool error: java.lang.Exception: Keystore file does not exist: android-release-key.keystore
java.lang.Exception: Keystore file does not exist: android-release-key.keystore
at sun.security.tools.keytool.Main.doCommands(Main.java:745)
at sun.security.tools.keytool.Main.run(Main.java:343)
at sun.security.tools.keytool.Main.main(Main.java:336)

I am running this command from the root of my project directory, the same place I generated the key and use it to sign. What’s going on here? How am I able to use the key to sign my app while also receiving an error that the file does not exist? My assumption is I’m searching for the .keystore file in the wrong place, but I can’t seem to find it anywhere. Per the documentation, I didn’t specify a path when I created the key, where is it .keystore file saved by default? I’m on Mac by the way.

2 Likes

I am also experiencing this issue. Were you able to resolve this?