"Gradle sync failed: No installed build tools found. Install the Android build tools version 19.1.0 or higher"
Asked Answered
T

13

20

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

Thyroxine answered 26/3, 2017 at 13:32 Comment(5)
can you see any buildTools installed if you open SDK-Manager?Petasus
@Yazan, yes. according to SDK Manager I have the following installed: 19.1.0, 20.0.0, 24.02 (none of them is mentioned to be obsolete)Thyroxine
The cordova does not find environment path correctly, but the path set correctly.Rescript
You must run your command as root user. Sudo is not enough. So run "sudo -s" to change to root. And re-run your command againCounty
programmersought.com/article/89467857203Clemenciaclemency
D
26

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

Digest answered 8/9, 2017 at 8:42 Comment(1)
Please where can i download the full version of Android SDK?Ruminant
F
18

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

Furcula answered 14/5, 2018 at 12:11 Comment(3)
For me the :$ANDROID_HOME/platform-tools is what was missing from my PATH and solved the problemDebonair
Thank you, on Fedora the first line should be export ANDROID_HOME=/home/<user>/Android/SdkIndiaindiaman
@AvramVirgil Feel free to edit my answer to add your note about Fedora.Furcula
M
12

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.

Methenamine answered 26/8, 2017 at 17:3 Comment(2)
I tried so many ways by adding path to bash_profile. None of them worked. This works!Proconsulate
Many thanks! This worked for me sdkmanager "build-tools;30.0.3" --verboseCowherd
G
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://static.mcmap.net/file/mcmap/ZG-AbGLDKwfpKnMxcF_AZVLQamyA/GTc0o.jpg

I hope this helps

Glassworker answered 24/5, 2017 at 17:54 Comment(1)
helped me. ThanksDemodulator
C
4

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

Carycaryatid answered 3/5, 2020 at 10:31 Comment(1)
Yes! This is the answer!!Banal
M
3

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

android{
   buildToolsVersion "specify the build tools version here"
}
Myosotis answered 12/4, 2017 at 7:8 Comment(0)
W
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.

Watchword answered 6/9, 2018 at 2:42 Comment(0)
S
0

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

Stopoff answered 6/12, 2019 at 6:37 Comment(0)
F
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
Fertilizer answered 9/1, 2021 at 6:3 Comment(0)
M
0

In my case, I was getting this error message because both ANDROID_HOME and ANDROID_SDK_ROOT variables were defined

Something like this :

export ANDROID_HOME="$HOME/path/to/Android"
export ANDROID_SDK_ROOT="$ANDROID_HOME/sdk"
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/build-tools

In that case, it looks like ANDROID_HOME was taking precedence over ANDROID_SDK_ROOT

Once I removed ANDROID_HOME variable it solved my problem magically :-)

Megathere answered 31/5, 2021 at 11:0 Comment(0)
M
0

Sometimes just recheck local.properties and run build command from terminal

Migration answered 29/1, 2023 at 12:11 Comment(1)
Grammer error. Remove "of a" word from sentanceHooves
P
0

In my case i open my cordova.gradle in android Studio, i tried to build it, despite i have installed the build-tools 33.0.2 i still says No installed build tools found. I tried to log the getAndroidSdkDir() and i found the error. In my env variable ANDROID_SDK_ROOT "C:/users/johndoe/appData/android/Sdk" the variable i log is "C:/users/johndoe/appData/android" without the Sdk folder. In the doFindLatestInstalledBuildTools() function i add the "Sdk" before the "build-tools" and it works.... Hope this helps i spend a couple days on it.

Publicity answered 22/7, 2023 at 14:49 Comment(0)
K
0

In my case for some reason when installing SDK 34 it decided to change the folder name from ..Android\sdk to ..Android\Sdk (with an uppercase S) so I changed that in the environment variables and it worked.

Komsomol answered 24/3, 2024 at 13:57 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.