nativescript-cli: Android SDK is not installed or is not configured properly, environment looks ok.
First of all, I am very new to Nativescript. I am in the process of trying to set it up on windows 10. I have all the tools installed as far as I can tell and have made sure my android environment is setup. When I type android at the cli I get the sdk manager and have them installed (sdk build tools etc).
Java is at version 1.7.0_55 on my box and that seems fine. What is not fine is that Nativescript insists my ANDROID_HOME is not set or is invalid.
I have run a doctor script which I include (attached) log.txt
I looked at the first error which was adb help and I ran that command directly from the same shell I got the following output from adb.exe
The reason I am filing this issue is because I receive an errror when trying to add a platform using
tns platform add android
When I issue this command I get the following message:
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.
This appears not to be the case. And so I am filing an issue as I cannot add the android platform to my app.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 30 (5 by maintainers)
Commits related to this issue
- Updated ANDROID_HOME env variable value ANDROID_HOME env value if set as per documentation mentioned [here](https://github.com/NativeScript/nativescript-cli/issues/1813) does not work always. So upda... — committed to jagadish-kb/docs by deleted user 5 years ago
- Updated ANDROID_HOME env variable value (#1684) ANDROID_HOME env value if set as per documentation mentioned [here](https://github.com/NativeScript/nativescript-cli/issues/1813) does not work always.... — committed to NativeScript/docs-v7 by jagadish-kb 5 years ago
I have the same problem, on mac 😦
Not sure if this helps anyone but I had the same issue on Linux (Ubuntu) after issuing:
However, in the end I realised it was my environment variables not being carried forward to sudo. Once, I added:
to the bottom of /etc/sudoers it worked perfectly.
After install. ANDROID_HOME = C:\Users\Usr\AppData\Local\Android\android-sdk but the route not exist, i access to C:\Users\Usr\AppData\Local\Android and i can see the folder sdk so i change. ANDROID_HOME = C:\Users\Usr\AppData\Local\Android\sdk and it works
I try do it on linux export ANDROID_HOME=‘/media/destructor/Media/Install/Linux/android-sdk-linux/’ but get next warnings 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 build your projects for Android and run them in the native emulator. To be able to build for Android and run apps in the native emulator, verify that you have installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
NOTE: You can develop for iOS only on Mac OS X systems. To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.
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. To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later. Run $ sdkmanager to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: ‘>=23 <=26’. Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system. Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.
Remove the User Variable Add the System Variable ANDROID_HOME Point the System Variable to C:\Program Files (x86)\Android\android-sdk Exit prompt and Open new Prompt and try again
I found the error. We must add android & java home paths to system variables. Not user variables. Finally I fixed the issue
@LuisGhz It worked like charm. I think NativeScript is looking for the SDK path “C:\Users\Usr\AppData\Local\Android\sdk” which i set as the “ANDROID_HOME” environment variable, not this “C:\Usr\Android\android-sdk” . I have spent my time download un-necessary packages.