98

When I boot up Android Studio and select "New Project..." and go through creating a new project, I get this popup error:

Failed to import new Gradle project: failed to find Build Tools revision 17.0.0

Consult IDE log for more details (Help | Show Log)

I would love to consult the IDE log, but I haven't even managed to get into the application to do much of anything. I've went through the preferences multiple times to see if I can set a path for the Build Tools, but I can't find much of anything. How do I fix this, or how do I get into the application without opening a project so I can at least see the logs?

Community
  • 1
  • 1
Jason Robinson
  • 31,005
  • 19
  • 77
  • 131

14 Answers14

96

After spending a few hours: I restarted the Android SDK Manager and at this time I noticed that I got Android SDK Platform-tools (upgrade) and Android SDK Build-tools (new).

After installing those, I was finally able to fully compile my project.

Note: The latest ADT (Version 22) should be installed.

Community
  • 1
  • 1
  • 5
    In my case I had the correct version of the Android SDK Build-tools installed, but I was looking in the Android SDK that I had been using with Eclipse. Android studio comes with a bundled Android SDK, localed in `/sdk`. Start the Android SDK Manager by running `/sdk/tools/android` and install the correct version of Android SDK Build-tools and you should fix the problem. – andre Oct 19 '13 at 07:44
  • You may want to rename this question to "failed to find Build Tools revision *.0.0" – ooolala Nov 07 '13 at 05:22
  • 1
    `SDK Manager` is found in Windows' programs menu under `Android SDK Tools`. In the SDK Manager window, there is a 'Tools' heading. Under that you should find various versions of `Android SDK Build-tools`. Run as administrator so it can manipulate local files. – Dale Mar 24 '16 at 13:11
  • Basically what @Dale said. If you click "Launch Standalone SDK Manager" you'll see more options and the Android SDK Build-tools should be in there. – stealthysnacks Aug 26 '16 at 00:27
  • This does not address installing older versions of the build tools. See https://stackoverflow.com/a/39068538/973624. – mrtumnus Apr 30 '18 at 15:24
  • In my case, unistalling some older version of Android SDK Build-tools in Android SDK Manager survives me. – MrSalesi Jun 05 '21 at 23:27
87

As of May 2020, A really straightforward solution using Android Studio:

  1. Open Android Studio
  2. From the top, choose File > Settings > Appearance & Behavior > System Settings > Android SDK
  3. click on the tab SDK Tools at the top. Then highlight Android SDK Build Tools from the list.
  4. Check "Show Package Details" check box, choose the build tools version you need and then click Apply.
Black
  • 18,150
  • 39
  • 158
  • 271
C.Lee
  • 10,451
  • 9
  • 31
  • 46
19

Look in the SDK Manager what is your highest Android SDK Build-tools version, and copy this version number in your project build.gradle file, in the android/buildToolsVersion property (for me, version was "18.1.1").

Hope it help!

Nicolas Buquet
  • 3,880
  • 28
  • 28
  • Hi. The site's system seems to think that this is a duplicate of [this answer](http://stackoverflow.com/questions/18767494/update-android-built-tool-to-18-0/19432696#19432696), perhaps you could update each to more specifically address each question, or flag the question as a duplicate? Thanks! – nanofarad Oct 17 '13 at 22:17
  • 1
    Yes, when I updated to Android 4.4, I forgot to update that section in my build.gradle file. The most current buildToolsVersion is now 19... – IgorGanapolsky Nov 04 '13 at 20:01
8

This is what I had to do:

  1. Install the latest Android SDK Manager (22.0.1)
  2. Install Gradle (1.6)
  3. Update my environment variables:
    • ANDROID_HOME=C:\...\android-sdk
    • GRADLE_HOME=C:\...\gradle-1.6
  4. Update/dobblecheck my PATH variable:
    • PATH=...;%GRADLE_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
  5. Start Android SDK Manager and download necessary SDK API's
Jan-Terje Sørensen
  • 14,468
  • 8
  • 37
  • 37
  • 1
    In particular if you've manually set your $ANDROID_HOME in your bashrc to some other install of the SDK (not the one that comes with Android Studio), the build scripts may get confused. This happened to me on Mac OS X. I had another SDK install in my shell $PATH that messed it up. – Pierre-Antoine LaFayette Aug 09 '13 at 00:45
5

It happens because Build Tools revision x doesn't exist.

Today, the latest version is 23.0.2 (subject to change all the time).

The buildToolsVersions you want are included in the Android SDK, normally installed in the <sdk>/build-tools/<buildToolsVersion> directory.

Don't confuse the Android SDK Tools with SDK Build Tools.


Change in your build.gradle's buildToolsVersion to some version installed in <sdk>/build-tools

android {
   buildToolsVersion "23.0.2"
   // ...

}
activedecay
  • 10,129
  • 5
  • 47
  • 71
5

Whenever you will try to run a project with build tool version not present in studio, You will face this error.

As of now in 2017, It has been made really simple by Android Studio.

It will prompt you about this issue, along with something like this

A screenshot from Android Studio

A screenshot from Android Studio

You just have to click on it and the system will download to the build version required to run the project.

Black
  • 18,150
  • 39
  • 158
  • 271
Anuj Agarwal
  • 51
  • 1
  • 2
  • Hey @Anuj - Can you add the Image in to the answer itself? – garfbradaz Jun 27 '17 at 15:40
  • @garfbradaz According to SO rules, I cannot add images in the answer itself until I have 10 reputations (I am a newbie here:-D ). So once I reach there, I'll update my answer. Thanks for the suggestion my friend. If this answer helps you, You can upvote it. Thanks! – Anuj Agarwal Jun 27 '17 at 15:46
  • My bag matey - ignore me! :) – garfbradaz Jun 27 '17 at 15:47
  • Hah.. I expanded the error tree to look for the root source. It shows the error message, so I started searching, and the top answers appear to be wrong nowadays - the version I have doesn't even have the menu options mentioned. But this answer made me go back and look at the root of the error tree, which does have the mentioned link. – Izkata Jun 24 '18 at 04:53
  • hell yeah, perfect answer! – Dee Oct 01 '18 at 21:12
3

I had the API 17 installed but that was not enough. What I really need installed is the "Android SDK Build-Tools 17".

You can locate your "Android SDK Build-Tools X" inside the first child, named "Tools", in the "Android SDK Manager".

Pang
  • 9,564
  • 146
  • 81
  • 122
3

in your Project perspective, look for Application --> build.gradle and edit this lines

android { compileSdkVersion "android-N" buildToolsVersion "24.0.0 rc1"

like this:

android { compileSdkVersion 24 buildToolsVersion "23.0.3"

Dan Alboteanu
  • 9,404
  • 1
  • 52
  • 40
2

I had this problem recently, my project didn't include local.properties file.

Check local.properties file if it includes sdk.dir with correct path to sdk

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Tomek Kozlowski
  • 604
  • 7
  • 6
1

i think you can download the latest android SDK and use it.i do this and fixed the problem and work well. here is the link: http://developer.android.com/sdk/index.html#download

littleyang
  • 41
  • 2
1

Try to run gradle at the command line first. It might prompt you to setup and environment variable:

export _JAVA_OPTIONS="-Xms256m -Xmx1024m"

Read more here: 1, 2


Further make sure that the Android SDK build tools (adb, aapt, dx, dx.jar) are available in the PATH. If not you can create symlinks at the appropriate locations. They changed with the release of new SDK versions. Here is a shell script which creates the symlinks within the $ANDROID_HOME folder for you.

Community
  • 1
  • 1
JJD
  • 50,076
  • 60
  • 203
  • 339
1

Basically error saying your are missing "Android SDK Build-tools" installed.

Maxim Galushka
  • 397
  • 1
  • 5
  • 22
1

This worked for me after I tried many solutions:
For some reason the adb process didn't restart itself after installing new packages. Manually killing adb.exe and attempting to import the project another time solved this problem for me.

Kirby
  • 15,127
  • 10
  • 89
  • 104
Crigges
  • 1,083
  • 2
  • 15
  • 28
0

Uninstall the Android SDK Tools and then reinstall them from Tools > SDK Manager.

Screenshot of how to uninstall SDK Tools

g00glen00b
  • 41,995
  • 13
  • 95
  • 133