18

I'm trying to open an Ionic2 Project in Android Studio, but it gives me the following error into the Event Log: "Gradle sync failed: No installed build tools found. Install the Android build tools version 19.1.0 or higher. Consult IDE log for more details (Help | Show Log)" SCREENSHOT

I have seen a similiar problem stated before (also maybe one of the latest release of Ionic2 or Cordova broke something -> https://github.com/driftyco/ionic/issues/10604).

Changing the version of "buildToolsVersion" or "compileSdkVersion" from gradle.build file or from Project Structure didn't help.

Under "C:\Users\Gaby\AppData\Local\Android\sdk\build-tools\24.0.3", I installed the 24.0.3 build tool version.

The path variable from environment variables indicates also the path correctly

At one moment, I had all build-tools installed with "android update sdk -u -a" but again, the same error occured.

Does anybody know a suitable workaround to this issuse ?

Many thanks

Gabriel Simon
  • 181
  • 1
  • 1
  • 5

9 Answers9

21

You need to write the correct "Environment Variables". See: https://developer.android.com/studio/command-line/variables

Windows:

setx ANDROID_SDK_ROOT "C:\android-sdk-windows"
setx PATH "%PATH%;%ANDROID_SDK_ROOT%\tools;%ANDROID_SDK_ROOT%\platform-tools"

Mac OS X

export ANDROID_SDK_ROOT=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools

Linux

export ANDROID_SDK_ROOT=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools

Update: ANDROID_HOME is deprecated, ANDROID_SDK_ROOT is now the correct variable

amm0nium
  • 115
  • 1
  • 3
Roman Kostyk
  • 211
  • 2
  • 4
16

First of all make sure build tools are installed.

After that open terminal on MacOS and change .bash_profile file:

nano ~/.bash_profile

you should add following lines:

export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools:$ANDROID_HOME/platforms

ctrl+O and ctrl+X

reload android studio

Dmitry Grinko
  • 8,671
  • 12
  • 35
  • 63
11

If you set ANDROID_STUDIO enviroment variable properly, than it means that, you have not installed build tools.

Rename the tools folder in %ANDROID_HOME% to tools_old, then With command line interface use:

sdkmanager tools --verbose

Old tools folder (tools_old) can be deleted, use the updated sdkmanager:

sdkmanager "build-tools;26.0.1" --verbose

The version number can be different. Use:

sdkmanager --list --verbose > packages.txt

Check the packages.txt file for available versions.

4

In my case the problem was produced by a wrong ANDROID_HOME path.

I've modified my ANDROID_HOME path is pointing to C:\android-sdk. This folder contains the below files

https://i.stack.imgur.com/GTc0o.jpg

I hope this helps

NickCoder
  • 1,232
  • 1
  • 15
  • 29
3

Try to disable doFindLatestInstalledBuildTools() method and in cordova.gradle and manually specify the buildToolsVersion in cordova build.gralde file as below

android{ buildToolsVersion "specify the build tools version here" }

Narendrakumar
  • 133
  • 1
  • 6
2

1.Open Android studio 2.Go to SDK Manager 3.Then Appearance and Behaviour ->System Setting -> Android SDK 4.SDK Tools 5.Select Android SDK Build Tools 6.install 19.1.0

Build Tools Build Tools

Ticherhaz FreePalestine
  • 1,476
  • 4
  • 13
  • 38
0

Mac OS X

cd ~
nano ~/.bash_profile

export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

echo $ANDROID_HOME // Verify the path

source ~/.bash_profile

It works for me.

Pang
  • 8,605
  • 144
  • 77
  • 113
0

You need to add "Environment Variables" ,ANDROID_SDK_ROOT
Android SDK location

Or Choban
  • 1,519
  • 1
  • 5
  • 8
0
  • Add ANDROID_SDK_ROOT to your Environment Varibales => System Variables.
  • ANDROID_SDK_ROOT should contain the Android SDK path , my path was C:\Users\developer\AppData\Local\Android\Sdk