Detect Android SDK using ANDROID_SDK_ROOT env var
See original GitHub issueEnvironment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
- CLI: 7.0.7
- Cross-platform modules:
- Android Runtime:
- iOS Runtime:
- Plugin(s):
Describe the bug
On running the command ns doctor
, I get this 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.
However, I have the ANDROID_SDK_ROOT
env var set which is equivalent to ANDROID_HOME
.
To Reproduce
Run ns doctor
Expected behavior
I expected it to detect the Android SDK using the ANDROID_SDK_ROOT
env var.
Sample project
Additional context
https://developer.android.com/studio/command-line/variables#envar
The ANDROID_HOME
env var is deprecated. Refer to the link above.
Please guide me on how to fix this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Where is android_sdk_root? and how do I set it.?
You need to make a system env variable with the name: ANDROID_SDK_ROOT and it's value should be C:\Users\your_user_name\AppData\Sdk\tools\bin worked for me.
Read more >Environment variables - Android Developers
Learn how to set environment variables for Android Studio and the command-line tools that specify things like where the SDK is installed and ......
Read more >Android SDK and Emulator
To manually set the Android environment variables for a Mac computer, do the following: In the home directory, locate .bash_profile , and then...
Read more >How to Set Path Environmental Variable for SDK in Windows?
Put ANDROID_HOME as Variable name and provide the path of the SDK ... This will open the Android SDK Manager dialog box, as...
Read more >Specify a path to Android SDK root folder - Katalon Docs
You can rename or move your Android SDK root folder to another location and use the ANDROIDHOME environment variable to point the path...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You could pack the doctor package with
npm pack
and in the CLInpm install /path/to/nativescript-doctor....tgz
.Not sure how you are running the CLI, the quickest way that I’ve been using lately is
npx grunt watch:ts
and then run the CLI with the full path to it/path/to/nativescript-cli/bin/nativescript.js doctor
for example.Either way is fine, don’t think it matters too much.
Just to keep it as it is now, look for
ANDROID_HOME
and then fall back toANDROID_SDK_ROOT
for now - we can always switch this out in the future if we need to.