I am trying to get ionic to build to my android phone locally. I have been following the instructions here: https://ionicframework.com/docs/v3/developer-resources/platform-setup/windows-setup.html. And I have gotten to the point where you type java or android into the terminal. I am getting the expected output from both after adding all of my variables to the path. However when I close the command promt and open it back up, if I type java it still works, but typing android causes it to say it can't be found
'android' is not recognized as an internal or external command,
operable program or batch file.
If I run
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
If I type android I get the desired output again. Then if I close and open the command prompt and type in android again I get the
'android' is not recognized...
error again. Does anyone have any advice on how to fix this?
UPDATE: I have gotten to a new error, turns out the previous error was occuring because OpenJDK gets installed with android studio, and it doesn't have the correct stuff for ionic (afaik). So I had to uninstall it then JAVA_HOME was pointing to the right thing.
But now I am running into a weird error where javac -version can't be found by ionic but I can run it as the next command without any problems: