Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to build project with Android studio

Can anyone tell me why I'm getting this error with AndroidStudio?

Execution failed for task ':sampleapp:preBuild'. > Build Tools Revision 19.0.0+ is required. 

I have installed Android Build-tools 19.0.1 from the Android SDK manager

like image 999
Karlis Avatar asked Jan 25 '14 17:01

Karlis


People also ask

Why is my Gradle build failing?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


2 Answers

Check all your build.gradle files whether they are using the 19.0.x version or not.

buildToolsVersion will be defined under the android tag inside the build.gradle file, like this:

android {      compileSdkVersion 19      buildToolsVersion '19.0.3'       // Other Configuration } 

You can find a list of versions for the Android Build Tools here as well as in the SDK Manager.

like image 112
Piyush Agarwal Avatar answered Oct 01 '22 03:10

Piyush Agarwal


Go to Window->Android SDK Manager and run it

You will see Android Build-Tools version installed...

Change build.gradle to reflect the installed version of build tools

This worked for me

OR

Install the version which is shown in error

like image 34
user3013143 Avatar answered Oct 01 '22 01:10

user3013143