NativeScript / NativeScript/nativescript-cli

Detect Android SDK using ANDROID_SDK_ROOT env var

Open
#5,386 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the implementation behind ns doctor and its Android SDK environment-variable check; the issue does not name a file or test. Verify behavior with ANDROID_SDK_ROOT set and ANDROID_HOME absent, and confirm that ns doctor recognizes the SDK without the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.