Unable to locate the Android build tool for Ionic2 Cordova development

As I attempted to create an APK using

ionic cordova build android

I suddenly encountered the following error message:

  * What went wrong:
    A problem occurred evaluating root project 'android'.

No installed build tools found. Install the Android build tools version 19.1.0 or higher.

Despite having android build tools from various versions of Android Studio (2.1.1 - 22.0.0 - 23.0.0) and the latest version 26.0.1, this issue persists.

Here is the output of running cordova requirements:

Requirements check results for android: Java JDK: installed 1.8.0 Android SDK: installed true Android target: not installed android: Command failed with exit code ENOENT Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle Error: Some of requirements check failed

The AndroidManifest.xml file shows the following uses sdk information:

    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />

Installed platforms: android 6.2.3

Answer №1

Have you ensured that your Android SDK folder is included in your environment variables?

Make sure to include the root Android SDK folder (such as C:\android-sdk or

C:\Program Files (x86)\Android\android-sdk\
) in both the ANDROID_HOME and ANDROID_SDK_ROOT environment variables.

Additionally, add (or adjust to match your current Android SDK folder):

C:\Program Files (x86)\Android\android-sdk\tools

C:\Program Files (x86)\Android\android-sdk\platform-tools

And perhaps:

C:\Program Files (x86)\Android\android-sdk\build-tools\26.0.1

Add these paths to your system's PATH variable.

Next, download only the binary for Gradle from here.

  1. Extract it to C:\Gradle. For example: C:\Gradle\gradle-3.5
  2. Add
    C:\Gradle\gradle-CURRENTVERSION\bin
    to the PATH variable.

After completing these steps, restart your computer or reopen any terminal where you are running commands.

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

Is there a way to extract information from an HttpClient Rest Api through interpolation?

I am currently facing an issue with a component in my project. The component is responsible for fetching data from a REST API using the HttpClient, and the data retrieval seems to be working fine as I can see the data being logged in the Console. However, ...

The build.gradle file is unable to locate the classpath() method with arguments [com.android.tools.build:gradle+] as specified

Hey there, I'm currently studying IT and facing an issue that says: "Could not find method classpath() for arguments [com.android.tools.build:gradle:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler." I ...

How to monitor and respond to HTML modifications in a child component from a parent component in Angular framework

In the setup I have, there is a main component known as @Component({ selector: 'parent-comp' template: '<child-comp [inputData]="responseData"></child-comp> }) export class ChildComponent { public responseData: any; ...

Issue: Could not locate the specified dependency: com.android.support.constraint:constraint-layout:1.0.0-alpha4 at line 30, position 13

Issue at line 30: Unable to locate: com.android.support.constraint:constraint-layout:1.0.0-alpha4 ...

Guide on how to programmatically activate a disabled button that has been set in the layout

As someone who is new to the world of Android, I am currently learning how to work with spinners, buttons, and their attributes. In my app, I have 4 spinners where each spinner's values are dependent on the selection made in the previous spinner. Bel ...

communication link between smartphone and computer

I am looking to create a connection between a mobile device and computer for interactive communication. I want the ability to send and receive data on both ends, similar to a chat client. Can you provide guidance on how to achieve this? I am considering ...

What is the best way to retrieve data (using GET) following React state changes?

Whenever a user clicks on one of the orderBy buttons (such as name/email/date), a new rendered result should be fetched from the server by sending a new get request. The same applies to page pagination. Simply setting this.setState({ [thestate]: [newState ...

Guide to utilizing @types/node in a Node.js application

Currently, I am using VSCode on Ubuntu 16.04 for my project. The node project was set up with the following commands: npm init tsc --init Within this project, a new file named index.ts has been created. The intention is to utilize fs and readline to read ...

Methods in the RxJava library

I'm currently learning about rxjava with the help of this enlightening article: and I'm encountering difficulties in reproducing the first example mentioned in the article. Here's what I've tried so far: Observable<List<String&g ...

What is the best way to ensure type safety in a Promise using Typescript?

It seems that Promises in Typescript can be type-unsafe. This simple example demonstrates that the resolve function accepts undefined, while Promise.then infers the argument to be non-undefined: function f() { return new Promise<number>((resolve) ...

PWA icons disappear when adding to the home screen

After incorporating icons of varying sizes (144x144 and 194x194) and establishing pwa-manifest.json, I encountered the following code: { "short_name": "app", "name": "Application", "icons": [ { "src": "assets/images/favicon ...

How to securely encode a string for a GET request in Angular 2 and Slim PHP Framework

Workspace My current setup involves a frontend developed with Angular2 that connects to an API built using Slim PHP Framework v4. Within the Angular frontend, users can input text into a form, submit it, and receive a response from the API. The Angular ...

methods to ensure a preselected value remains in use within mat-select in the context of Angular

In my current project, I've incorporated a unique mat-select component. Here's the corresponding code: <div class="col-md-6"> <mat-form-field> <mat-select placeholder="Select Job" formControlName="job_instruc ...

Issue encountered with Angular Material's md-chips and md-autocomplete: The error message "control.registerOnChange is not a

When attempting to wrap mat-chips and mat-autocomplete into a ControlValueAccessor, I encountered the following errors: InfoEditorComponent.html:17 ERROR TypeError: control.registerOnChange is not a function at setUpModelChangePipeline (forms.js:2701) ...

Troubleshooting problems with styled and typed components in ReactJS

I created a styled component with the following structure: export const TestClassButton = styled(Button)({ ... }) Here is an example of how I implement it: <Tooltip arrow title={"status"}> <TestClassButton id={"button-statu ...

Achieving automatic checkbox selection in Angular 6 through passing a value from one component to another

My page named second.html contains the following code: <div class="col-lg-4 col-md-4 col-sm-4"> <input type="checkbox" class="checkmark" name="nond" [checked]="r=='true'" (change)="nond($event, check)"> ...

Exported Members or Node Modules are not available

Starting out with Angular 2 / Typescript and following the 5 Minute Quickstart guide located here. I've come across a common issue, but with a slight twist. I'm running into several "No Exported Member" problems. For example: In app.module.ts: ...

Unclear button focus when working with several NG Bootstrap datepickers

I am currently utilizing Angular 8 along with NG Bootstrap. One issue I have encountered is that when I have multiple NG Bootstrap datepickers in a single form and click between the datepicker buttons without selecting any dates, the button focus appears ...

Tips for merging bind values into a fresh variable within Angular 2/4

Hey, I'm currently working with a template in Angular 4 and here's the code snippet: <tr *ngFor="let row of rows"> <td> <a [routerLink]="['/test/test1', id1, id2]"> {{row.summary[0].width}} ...

The Offcanvas feature is failing to function properly, resulting in the content failing to display

How are you doing? So, I have a little challenge for you! I'm currently working on implementing an Offcanvas Component in my Angular Project. It seems to be working fine, except when I activate the component, all I see is the shadow effect and no act ...