GeezerVison is showing github.com — The Android SDK isn't installed or it's not configured properly · Issue #3585 · NativeScript/nativescript-cli
The Android SDK isn't installed or it's not configured properly #3585DescriptionSo, 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. ActivityFatme commented on May 15, 2018 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
Reacted by Tamaghna Banerjee, zheu and Max Brückner pierreamgabriel commented on May 15, 2018 @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 directory when I run $ANDROID_HOME Fatme commented on May 15, 2018 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? Fatme commented on May 15, 2018 Hi @pierremacedo,
Another thing we would like to ask you is to execute the following:
echo $ANDROID_HOME && tns doctor
Reacted by QUINCY HUTCHISON pierreamgabriel commented on May 15, 2018 @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
Fatme commented on May 16, 2018 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
Reacted by Ndi-Tah Samweld, Thiago da Silva Pereira and arLevi Reacted by Ndi-Tah Samweld Fatme commented on May 16, 2018 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
pierreamgabriel commented on May 17, 2018 @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. Reacted by linoman, Miroslav Maksimovic, Leonardo and Jose F. Lopez rosen-vladimirov commented on May 17, 2018 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:
- NativeScript Playground: https://play.nativescript.org - the Playground allows you to try the NativeScript framework with a minimum efforts. You have to download the required application from AppStore (PlayStore) and scan a QR code to deploy your app. In fact NativeScript Playground is the easiest and fastest way to try the technology itself.
- NativeScript Sidekick: https://www.nativescript.org/nativescript-sidekick - This Desktop application allows you to create, build and run NativeScript applications without any local configuration. The only requirements are to have NativeScript CLI installed and to have a Telerik account. NativeScript Sidekick allows you to use cloud builds (you have 100 free cloud builds each month) and local builds in case your local environment is setup.
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. IAMtheIAM commented on Aug 2, 2018 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. Reacted by qwekr and mikecaputozoomcare divyachandana commented on Oct 15, 2018 updating SDK in AndroidStudio >> Preferences would help
 WayneDV commented on Dec 30, 2018 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) eugenefvdm commented on Feb 23, 2019 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! Fatme commented on Feb 23, 2019 What is the output of echo ~? eugenefvdm commented on Feb 23, 2019 eugene@fintechsystems:~$ echo ~
bash: /home/eugene: Is a directory zleight1 commented on Jun 28, 2019 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. Reacted by Igor Caviroski, tlg-265, Don Milham, Jay Borenstein, Vitaliy Stanyshevskyy, Nicholas Gunner, AnderBalles98, Amol Bodhare, Juan Cruz Mendez, Braydon Harris and 3 more Danielhoifodt commented on Jul 15, 2019 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? mahmoudyusof commented on Jan 2, 2020 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"
Reacted by Artur Kurowski, Wojciech Tomczyk and adambeck7 gabrielg-dev commented on Feb 10, 2020 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. gajanannaik commented on Jun 30, 2020 
When i tried to run tns doctor i got this error help me please!
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|