"Keytool" command not found for apk signing, even though it's there in the JDK?


#1

Hello all!

So I have a little test version of an android application ready, just for showing the basics of how it will work for the people who requested it, and I can run the test on my own android phone just fine with the “ionic run android” command in Git Bash. Problem is, I have to send the APK to other people, and they of course can’t install the unsigned version.

So I looked up how to sign my apk through the ionic website, but problem is that I got stumped on the “keytool” command: it’s simply not found. The tutorial says that I should consult the Installation Guide about this, but I’m not sure on what part I messed up? The JDK is working/has worked when I installed the basics needed to develop Ionic, now it just straight up doesn’t have a clue about this “keytool” command, even though I found it in the Java folder.

Here are pictures to show what I’m talking about:

JDK Folder - Keytool
Keytool command used in Git Bash

So there it is. I’m at a loss as to what I’ve got wrong, could somebody help with a solution or perhaps recommend an alternative way of signing my APK?


#2

Have you looked at your PATH and JAVA_HOME environment variables?
Maybe you have the JRE in your path.


#3

@gmarziou is correct, this is probably related to environment variables. You’re missing mentioned folder inside your OS environment PATH.


#4

Thank you friends, that was the problem after all, my PATH value was not set right. It recognised the command this time.

Bah, it’s just always so infuriating that I get caught up on these small problems for hours/days sometimes, even though they can be fixed in under a minute.

Cheers, and thanks again! :smile:


#5

Hello, you mind posting the value for PATH and JAVA_HOME variables? i´m running thougth the exact same problem with no luck


#6

That’s something that depends on your environment. No point in sharing our PATH environment variables because they will differ from yours.