I am currently working on a Nativescript app with Angular and using a JSON server. However, I am facing some errors when I try to run 'tns run android' or 'tns doctor' commands.
× The ANDROID_HOME environment variable is either not set or directing to a nonexistent directory. This will prevent any Android build-related operations from being performed.
To resolve this, set the ANDROID_HOME
variable to point to the root directory of your Android SDK installation.
× WARNING: The adb tool from the Android SDK is either not installed or not configured properly. For any Android-related operations, NativeScript CLI will use its internal version of adb. To avoid potential issues with the native Android emulator, Genymotion, or connected Android devices, make sure you have the latest Android SDK and its dependencies installed as outlined in http://developer.android.com/sdk/index.html#Requirements
× WARNING: The Android SDK is either not installed or not configured properly. This will prevent running apps in the native emulator. To enable app execution in the native Android emulator, ensure that you have the latest Android SDK and its dependencies installed as detailed in http://developer.android.com/sdk/index.html#Requirements
× Unable to locate a compatible Android SDK for compilation. To build for Android, Android SDK 28 or later must be installed.
Use $ sdkmanager
to manage your Android SDK versions.
× Android SDK Build-tools must be installed on your system. You can install any version within the range: '>=23 <=28'.
Run $ sdkmanager
from your command-line to install the required Android Build Tools
. If already installed, ensure the ANDROID_HOME
environment variable is set correctly.
× Error encountered when executing 'javac' command. Ensure the Java Development Kit (JDK) is installed and JAVA_HOME environment variable is set correctly. Without this, Android project building will not be possible. To enable Android building, make sure the JDK is installed and configured according to the system requirements specified at
× WARNING: The Java Development Kit (JDK) is either not installed or not configured properly. This can hinder interaction with the Android SDK and impact certain Android-related operations. To facilitate the development and testing of your Android apps, ensure the JDK is installed and configured as described in http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html (for JDK 8).
Despite having installed JDK and Android Studio, along with setting up the SDK in Android Studio, these errors persist.