1
votes

I am very new to nativescript and just starting up a new project using nativescript. I am trying to run nativescript starter template using tns run android and its showing error saying The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.

Can someone help me in fixing in this issue please?

1
Can you provide more info about your operating system? Also, did you managed to successfully complete the installation steps as described here: docs.nativescript.org/start/quick-setup? - anthares
@anthares I completed the setup without any errors. I am using Windows 8. - Climb Tree
were you using the manual setup instructions or the Windows installer? - Nick Iliev

1 Answers

1
votes

For some reason the ANDROID_HOME environment variable on your machine is not created successfully. You can try to set it up manually, using the following PowerShell command:

[Environment]::SetEnvironmentVariable("ANDROID_HOME", "<Path to Android SDK>", "Machine")

You will need restart your console in order this to take effect. By the way, if you run tns doctor, it should tell you if there is a problem with your local setup.