同步失败: 找不到构建工具修订版24.0.0 rc1

从今天开始,我在设置 Android Studio 中的新项目时遇到了一个错误。在创建了一个空白项目之后,日志中提到“ Gradle sync 未能成功: 未能找到 Build Tools 24.0.0 rc1修订版”

首先,我在网上查看如何解决这个问题,遇到了 这个类似的问题,然后按照给出的解决方案(在模块设置中设置构建工具版本)。然而,这导致了 Android Studio 告诉我无法找到“ Android ()”方法,并且“‘ TestBlankApplication’项目可能使用了一个不包含该方法的 Gradle 版本。”

此外,SDK 管理器通知我已经安装了 Build-tools 24 rc1。所以我不知道为什么 Android 工作室找不到它。

SDK 管理器的屏幕截图显示安装了24个 rc1: enter image description here

有人知道如何解决这个问题吗? 谢谢。

151556 次浏览

Try to change the buildToolsVersion for 23.0.2 in Gradle Script build.gradle (Module App)

and set buildToolsVersion "23.0.2"

then rebuild

Another thing is that all libraries from google (e.g. support lib, CardView and etc.) should have identical versions

I had same problem and eventually found out that in file build.gradle the version does not match the version of buildTools in my installed sdk. (because I imported project done at home on different computed with updated sdk)

before:

  • build.gradle(app): buildToolsVersion "24.0.2"

  • Android\sdk\build-tools: file "25.0.1"

fixed: build.gradle(app): buildToolsVersion "25.0.1"

Then just sync your project with gradle files and it should work.

  1. Follow the below procedure to solve the error.

  2. Go to File -> Project structure.

enter image description here

  1. From the drop down box, you will know all the version of build tools that are installed in your android studio.
  2. Look for a higher version. If Gradle cannot find 24.0.0, check if 24.0.1 is present in drop down.
  3. Do a complete code search. Find all the places where "24.0.0" is found. Replace it with "24.0.1"
  4. Do a gradle sync.

Why you got this error:

Android studio does not come with build tools for different android versions when you download it. It also does not make sense since there are multiple versions of build tools and each of them will take hundreds of megabytes on your hard drive. This is why Android Studio installation package is 1 GB while Xcode, which has all the build tools, is 6 GB

When you choose a specific build version in the build.gradle file, your android studio may or may not have that version of build tool installed. And if not, you will see the error complaining about it.

How to fix it

You just need to install the specific version of build tool mentioned in build.gradle like this:

  1. Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.
  2. Go to Appearance & Behavior > System Settings > Android SDK (Or simply search for Android SDK on the search bar)
  3. Go to SDK Tools tab > Check the Show Package Details check box
  4. Select the specific version of the build tool and click on the Apply button
  5. After the installation, sync the project

Demos

(I choose a different version just to show you how to apply the changes by that apply button :) )

enter image description here

And then sync the project. The error is gone now!

enter image description here

Go to Build Gradle (Module:app) Change the following. In my case, I choose 25.0.3

android {


compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.cesarhcq.viisolutions"
minSdkVersion 15
targetSdkVersion 25

After that, it works fine!

Android Studio updating didn't work for me. So I updated it manually. Go to your sdk location, run SDK Manager, mark desired build tools version and install.

I ran into a same problem. I was running portable version of android studio so downloaded a package from https://developer.android.com/studio/#downloads and installed it, and like that, done!

SDK tools required build tool version installation helped me. You just need to install required build tool version from,

SDK Manager -> SDK tool -> Show Package details -> Select required build tool version and install it.

1) You need to change to version that is available on you studio enter image description here

2) Here is how you find out version that is available for your studio

Go to File -> Project structure. enter image description here

source is from @Siddarth Kanted Thanks to Siddarth Kanted.

3) And when you want to install more versions of build tool you can learn it from @Fangming user from this post.

easy working solution.

I ran into this problem after a fresh install of Android Studio (in GNU/Linux). I also used the installation wizard for Android SDK, and the Build Tools 28.0.3 were installed, although Android Studio tried to use 28.0.2 instead.

But the problem was not the build tools version but the license. I had not accepted the Android SDK license (the wizard does not ask for it), and Android Studio refused to use the build tools; the error message just is wrong.

In order to solve the problem, I manually accepted the license. In a terminal, I launched $ANDROID_SDK/tools/bin/sdkmanager --licenses and answered "Yes" for the SDK license. The other ones can be refused.

faced the same problem: Gradle sync failed: failed to find Build Tools revision x.x.x

reason: the build tools for that version was not down loaded properly solution:

  1. Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.
  2. Go to Appearance & Behavior > System Settings > Android SDK (Or simply search for Android SDK on the search bar)
  3. Go to SDK Tools tab > Check the Show Package Details checkbox
  4. uncheck the specific version to remove it.
  5. click apply.

then follow the steps 1 to 3 and 6.

  1. Select the specific version of the build tool and click on the Apply button After the installation, sync the project