0

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: javac -version error

  • You have to add android SDK path form Variable Window. using this command only set it temporary. – Najam Us Saqib Jan 19 '21 at 04:16
  • Check These Q&A's https://stackoverflow.com/questions/23042638/how-do-i-set-android-sdk-home-environment-variable – Najam Us Saqib Jan 19 '21 at 04:17
  • I tried using the variable window and it doesn't work there either :(. It is like cmd is using a different context for the path. And that QA didn't seem to work for me, thanks for the link though. – kipples'N'bits Jan 19 '21 at 04:40
  • Check this link for set path `https://www.360logica.com/blog/how-to-set-path-environmental-variable-for-sdk-in-windows/` – Ravi Ashara Jan 19 '21 at 12:13
  • None of those suggestions worked, but I found a fix for that problem. Now I have run into something new though :( – kipples'N'bits Jan 20 '21 at 06:05

0 Answers0