Challenges faced with the Nativescript Software Development Kit

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.

Answer №1

Update your configuration file (in my personal instance .zprofile) with the following instructions:

export PATH=~/Library/Android/sdk/platform-tools:$PATH
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/$USER/.android/avd
export JAVA_HOME=/Library/Java/

Ensure you adjust the paths to match the location on your specific computer.

Afterward, execute source .zprofile, restart your terminal, and then attempt running tns doctor again. If you have Android Studio running, make sure to restart it as well.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Dismiss the validator upon completion of submission

Two textboxes were created, one for the title and another for the name. Validations have been implemented to only submit information if both textboxes are filled. The issue arises when attempting to clear the variable values after submission, triggering ...

Creating Versatile Functions for HttpClient Wrapping

Scenario: In my set of services, I find myself repeatedly writing code for data calls which results in a lot of duplicated code. To streamline the process and reduce redundancy, I am looking to implement a wrapper function: All these functions essentiall ...

Execute a function once an observable variable has been successfully initialized

I'm currently putting together a chat application using socket.io in Angular. I've encountered an issue where I can't seem to execute a particular code or function right after an observable variable is initialized through subscription. The i ...

Issue with Angular Material sorting (matSort) triggering ExpressionChangedAfterItHasBeenCheckedError

I have limited experience with JS, Angular, and even Node.js, but I needed to create a user interface for an application I am developing. I am learning as I go along and have managed to solve most issues on my own. However, I am currently facing an Express ...

The current inquiry does not conform to the MultipartHttpServletRequest format

I've been encountering an error while trying to send both an image and an object from Angular to Spring Boot. The error message I keep receiving is: Current request is not of type [org.springframework.web.multipart.MultipartHttpServletRequest] Below ...

I'm looking to display the message between the specified start date and end date that is selected in the input field

Is it possible to utilize ngOnChange? <div> <label for="start">Start date:</label> <input type="time" name="starts" [(ngModel)]="starts"> <label for="end">End date: </label> <input type="time" name="end" [(ng ...

Run a Nest.JS Kafka microservice while continuing to listen on port 3000

I have a Nest.JS microservice set up as follows: const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, { transport: Transport.KAFKA, options: { client: { brokers: ['localhost:9092'], } } }); aw ...

Can TypeScript support promise chaining in a functional way?

It appears that in the realm of JavaScript, one has the capability to execute: function extendPromise(promise) { return promise.then(new Promise(() => {})); } However, when incorporating types into the mix, such as function extendTypeScriptPromis ...

Angular - Update a single property of the environment

Managing multiple client environments in my Angular application has been a smooth process. Each client has its own set of variables, and by using the configuration flag, I can easily switch between them: { name: client1, address: client 1 address, ... ple ...

filtering an array based on a specific property will result in the original array remaining

Working on filtering an array of objects based on a certain property using the following code snippet: if (payment == Payment.CREDIT_CARD) { this.currenies.filter((currency: Currency) => currency.isFromEurope === true); console.log(this.currencies) ...

Steps for automatically closing a TextPrompt if the end user does not respond within a specific time frame

How can I programmatically close a Prompt in Microsoft Chatbot SDK v4, such as TextPrompt or ConfirmPrompt, and end the dialog after a certain period of time if the user does not reply? I attempted to use setTimeout and step.endDialog but encountered issu ...

Issue with TagCloud functionality when deployed on Vercel platform

Everything functions perfectly on my local machine, but once deployed to Vercel, the display disappears. I've double-checked the text, container, and TagCloud - all showing the correct responses. I even tried uninstalling and reinstalling TagCloud wit ...

Angular 2: Encounter with 504 Error (Gateway Timeout)

I am struggling with handling errors in my Angular 2 application. Whenever the backend server is offline, an uncaught error appears in the console: GET http://localhost:4200/api/public/index.php/data 504 (Gateway Timeout) This is how my http.get me ...

Do we still need to configure XSRF-TOKEN on the server even when using HttpClientXsrfModule?

Would implementing the code below in app.module be sufficient to protect against XSRF/CSRF on the client side? HttpClientXsrfModule.withOptions({ cookieName: 'XSRF-TOKEN', headerName: 'X-XSRF-TOKEN' }) Alternatively, is additional ...

Can *ngFor in Angular handle asynchronous rendering?

Within the code snippet provided, the line this.images = response.map( r => r.url).slice(0,10); populates the images array. The data is then rendered in the view using ngFor. Following this, a jQuery function is invoked to initialize an image slider. Ho ...

Respond to unsuccessful changes within a simple presentational element

Within my component, I have a feature that allows users to interact with and modify a specific entity. However, these modifications may be rejected at the server level. In such cases, I would like the component to initiate an animation to indicate to the u ...

"How to automatically populate an input field with a value when the page loads in an

I need assistance with setting the input value to 1 when the page is loaded, but for some reason, it remains empty. Can someone help me troubleshoot this issue? <tr *ngFor="let item of cartItems; let i=index"> <td class="cart_pr ...

Retrieve deeply nested array data using Angular service observable

My endpoint data is structured like this { 'dsco_st_license': { 'ttco_st_license': [ { 'csl_state': 'AK', 'csl_license_name': &ap ...

There seems to be an issue with locating a differ that supports the object '[object Object]' of type 'object'. NgFor is only compatible with binding to Iterables like Arrays

My route.js const express = require('express'); const router = express.Router(); const University = require('../models/university'); var mongo = require('mongodb').MongoClient; var assert = require('assert'); va ...

Consecutive requests to APIs using RxJs

Is it possible to efficiently make sequential API calls using RxJs? The challenge lies in the fact that the first Observable emits an array, and for each item in this array, a custom URL should be set for the next call. Additionally, certain conditions nee ...