更新时间:2023-11-22 09:51:46
下载Android Studio时,它没有针对不同android版本的构建工具.这也没有意义,因为有多种版本的构建工具,每个构建工具将占用您硬盘上的数百兆字节.这就是为什么Android Studio安装包为1 GB,而具有所有构建工具的Xcode为6 GB的原因
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:
(我选择一个不同的版本只是为了向您展示如何通过应用"按钮应用更改:))
(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!