且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-11-22 09:51:46

为什么会出现此错误:

下载Android Studio时,它没有针对不同android版本的构建工具.这也没有意义,因为有多种版本的构建工具,每个构建工具将占用您硬盘上的数百兆字节.这就是为什么Android Studio安装包为1 GB,而具有所有构建工具的Xcode为6 GB的原因

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

当您在build.gradle文件中选择特定的构建版本时,您的android studio可能会或可能未安装该版本的构建工具.如果没有,您将看到该错误的抱怨.

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.

您只需要安装build.gradle中提到的特定版本的构建工具,如下所示:

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

  1. 点击 文件 > 设置 (在Mac上为 Android Studio > 首选项 ) 打开设置对话框.
  2. 转到 外观&行为 > 系统设置 > Android SDK (或者 只需在搜索栏上搜索 Android SDK )
  3. 转到 SDK工具 标签>选中 显示软件包详细信息 复选框
  4. 选择特定版本的构建工具,然后点击 应用 按钮
  5. 安装后,同步项目
  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

(我选择一个不同的版本只是为了向您展示如何通过应用"按钮应用更改:))

Demos

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

然后同步项目.错误现在消失了!

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