简体   繁体   中英

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

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

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

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

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.

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

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" }

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构建工具

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.

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

  • 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

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 :-)

sometimes just recheck local.properties and run build command from terminal of a

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM