So, I'm definitely moving from Windows 7 to Linux Mint 18.3. I followed all the necessary steps to get NS running as described here https://docs.nativescript.org/start/ns-setup-linux.
When I run tns run android, this is the output:
โ Your ANDROID_HOME environment variable is set and points to correct directory.
โ A compatible Android SDK for compilation is found.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
โ WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html
i'm pretty sure the Android SDK is installed.
Hi @pierremacedo,
It seems your adb is not included in $PATH. {N} CLI tries to execute $ANDROID_HOME\platform-tools\adb to check if adb is correctly setup. To check it on your side, just execute adb from command line.
To include it in $PATH you can use
export PATH=$PATH:$ANDROID_HOME/platform-tools/adb
@Fatme Thank you but it didn't help and I just found out another problem: NS seems not to recognize the ANDROID_HOME variable set int .bashrc, because as soon as I restart the computer and run tns doctor it tells me the variable isn't set, but it in fact is, since I get this output bash: /home/pierre/android/sdk/: Is a directorywhen I run $ANDROID_HOME
Hi @pierremacedo,
{N} CLI gets ANDROID_HOME from process environment. There is no logic to check .bashrc or some other profile files.
process.env["ANDROID_HOME"]
Can you please confirm that you execute tns run command and $ANDROID_HOME from the same terminal?
Hi @pierremacedo,
Another thing we would like to ask you is to execute the following:
echo $ANDROID_HOME && tns doctor
@Fatme So now the variable and paths are permanently in environment, so no more warnings saying ANDROID_HOME isn't set.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/pierre/android/sdk/tools:/home/pierre/android/sdk/platform-tools:/home/pierre/android/sdk/platform-tools/adb"
ANDROID_HOME=/home/pierre/android/sdk/
tns run:
โ Your ANDROID_HOME environment variable is set and points to correct directory.
โ A compatible Android SDK for compilation is found.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
โ WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
$ANDROID_HOME:
bash: /home/pierre/android/sdk/: Is a directory
echo $ANDROID_HOME && tns doctor:
/home/pierre/android/sdk/
โ Getting environment information
โ Your ANDROID_HOME environment variable is set and points to correct directory.
โ A compatible Android SDK for compilation is found.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
โ WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
There seem to be issues with your configuration.
โ Getting NativeScript components versions information...
โ Component nativescript has 4.0.1 version and is up to date.
โ Component tns-core-modules has 4.0.0 version and is up to date.
โ Component tns-android is not installed.
โ Component tns-ios is not installed.
โ Your ANDROID_HOME environment variable is set and points to correct directory.
โ A compatible Android SDK for compilation is found.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
โ WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
Hi @pierremacedo,
I've noticed your $PATH has /home/pierre/android/sdk/tools but it seems you need /home/pierre/android/sdk/tools/bin. Not sure this will resolve your issue but can you please try it:
export PATH=$PATH:$ANDROID_HOME/tools/bin
After that can you please execute
adb && tns doctor
Hi @pierremacedo,
We discussed your problem and actually there are 2 scenarios that might cause this issue.
The first one is in case when android sdk is not fully installed or configured. To verify it, can you please execute
ls -la $ANDROID_HOME/platform-tools/adb
The second one is in case when adb server is already running. If this is the case, you need to kill the server. You can use the following:
$ANDROID_HOME/platform-tools/adb kill-server
@Fatme I think it was probably because I was using Linux 32-bit and google doesn't support this architecture but I didn't know that. But now I'm using a 64-bit Debian and I can't even install the required runtime libraries, so I'm definitely giving up on NS and moving to React Native. Thanks for your help.
Hey @pierremacedo,
My name is Rosen Vladimirov and I'm working on NativeScript since its beginning. I'm sorry to hear you have faced issues with the environment configuration and this led you to the decision to stop using the technology. In fact configuring the environment for both iOS and Android builds is not an easy task and as you have seen, we are still struggling with different issues on this side. However, the technology itself, the NativeScript framework, is really powerful. I'm not sure if you were able to give it a try, so I would like to suggest you to take a look at the following resources, which could give you another way to try NativeScript:
Once again I'm sorry to hear you have faced issues with the configuration. We'll be glad to assist you further in case you would like to give it a try.
If you are switching between platforms like Windows, Linux, and Mac - then you'll need the platform-tools appropriate for each platform aka on windows it is adb.exe and on linux it is adb - so get the platform tools for each platform from here and put them all in the same folder
As long as ANDROID_HOME points to the root of the sdk folder, it will work.
updating SDK in AndroidStudio >> Preferenceswould help

I have the same problem, and find that "sudo tns doctor" works fine - even though I installed everything in my non-privileged user's home folder. (SDKs, npm modules, nativescript, etc)
I ran into this problem. I tried following this advice:
eugene@fintechsystems:/$ ls -la $ANDROID_HOME/platform-tools/adb
but I get:
ls: cannot access '~/Android/Sdk/platform-tools/adb': No such file or directory
Then I skip using the environment variable and specify the hard path:
eugene@fintechsystems:/$ ls -la /home/eugene/Android/Sdk/platform-tools/adb
-rwxrwxr-x 1 eugene eugene 2704537 Feb 23 22:37 /home/eugene/Android/Sdk/platform-tools/adb
That works! Really confused so I changed directory using the environment which also works!
eugene@fintechsystems:/$ cd ~/Android/Sdk/platform-tools/
eugene@fintechsystems:~/Android/Sdk/platform-tools$ ls -ls adb
2644 -rwxrwxr-x 1 eugene eugene 2704537 Feb 23 22:37 adb
So to fix the problem instead of using ~/Android/Sdk I've just hard coded /home/eugene/Android/Sdk and now tns doctor works!
What is the output of echo ~?
eugene@fintechsystems:~$ echo ~
bash: /home/eugene: Is a directory
Hopefully this will help someone, on my machine all the Android SDKs/ADB were installed in my /Users folder (probably because I already had Android Studio installed).
I fixed it by setting the Android home path to point to the /Users/ sdk by running:
export ANDROID_HOME=/Users/zleighton/Library/Android/sdk
After that tns doctor reported everything OK.
Hi, i can not find the path where sdk and build tools are installed. I think they were installed on a wrong directory. i get the same problems as above. How can i find where sdk is installed?
I also have a problem with sdk configuration. the adb is installed and configured correctly, and I have added all the needed paths to the $PATH env variable, I have no idea what the problem is
here is the output of $ tns doctor
โ Getting environment information
There seem to be issues with your configuration.
โ Getting NativeScript components versions information...
โ Component nativescript has 6.3.0 version and is up to date.
โ Your ANDROID_HOME environment variable is set and points to correct directory.
โ Your adb from the Android SDK is correctly installed.
โ A compatible Android SDK for compilation is found.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options:
Select "Sync to Playground" to enjoy NativeScript without any local setup. All you need is a couple of companion apps installed on your devices.
Select "Configure for Cloud Builds" to install the nativescript-cloud extension and automatically configure your environment for cloud builds.
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Configure for Both Local and Cloud Builds" to automatically configure your environment for both options.
Select "Configure for Both Local and Cloud Builds" to automatically configure your environment for both options.
here are the edits I made to my ~/.bashrc file as well.
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
export ANDROID_HOME="/usr/local/android/sdk"
export PATH="$PATH:$ANDROID_HOME/tools/:$ANDROID_HOME/platform-tools/:$ANDROID_HOME/tools/bin"
I have another nativescript project on same pc and that run without problem, but nativescript-oauth2 github angular example show always "The setup script was not able to configure your environment for local builds"
Update (edit):
I just installed sdk build tools 29.0.3, 28.0.3 and 27.0.3 using sdkmanager and now it works.

When i tried to run tns doctor i got this error help me please!
Most helpful comment
Hopefully this will help someone, on my machine all the Android SDKs/ADB were installed in my /Users folder (probably because I already had Android Studio installed).
I fixed it by setting the Android home path to point to the /Users/ sdk by running:
export ANDROID_HOME=/Users/zleighton/Library/Android/sdkAfter that
tns doctorreported everything OK.