Android Studio Gradle BuildTools 修订版
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23999714/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio Gradle BuildTools Revision
提问by Gabriel Matusevich
I have an Android Project in Android Studio 0.5.9 and Gradle is throwing this error:
我在 Android Studio 0.5.9 中有一个 Android 项目,Gradle 抛出此错误:
Error:The SDK Build Tools revision (17.0.0) is too low. Minimum required is 19.0.0
I have already installed SDK Build Tools Revision 19 from the SDK Manager and here is my build.gradle
我已经从 SDK Manager 安装了 SDK Build Tools Revision 19,这是我的 build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'Manantiales/src/main/AndroidManifest.xml'
}
}
}
How do I tell gradle to use the Build Tools 19 if it's already installed?
如果已经安装了 Build Tools 19,我该如何告诉 gradle 使用它?
EDIT: I marked a different answer as The Best Answer because it was the one that worked for most people
编辑:我将一个不同的答案标记为最佳答案,因为它适用于大多数人
回答by Eric Labelle
I had the same problem this morning after updating to .6.0. You need to change you gradle version in /projectName/build.gradle
更新到 .6.0 后,我今天早上遇到了同样的问题。您需要在 /projectName/build.gradle 中更改您的 gradle 版本
classpath 'com.android.tools.build:gradle:0.11.+'
Open your SDK manager and download the new version of the build tools 19.1then change the following line in /projectName/moduleName/build.gradle
打开您的 SDK 管理器并下载新版本的构建工具 19.1,然后在 /projectName/moduleName/build.gradle 中更改以下行
android {
compileSdkVersion 19
buildToolsVersion "19.1" //This version needs to be updated to 19.1 after SDK update
...
}
Then sync your gradle filesand you should be good to go!
然后同步您的 gradle 文件,您应该一切顺利!
回答by Renato Isidio
I didn't realize that my errors changed when I changed buildToolsVersion "19.0.0"
to buildToolsVersion "19.1.0"
in my build.gradle.
我不知道,当我改变了改变了我的错误buildToolsVersion "19.0.0"
给buildToolsVersion "19.1.0"
我的build.gradle。
The first error was:
第一个错误是:
Error: The SDK Build Tools revision (19.0.0) is too low for project 'android'. Minimum required is 19.1.0
The second error was a little bit different, but I didn't see it:
第二个错误有点不同,但我没有看到:
Error: The SDK Build Tools revision (19.0.0) is too low for project ':CordovaLib'. Minimum required is 19.1.0
So I've also changed the build.gradle
inside the CordovaLib folder, and the error disappeared.
所以我也更改了build.gradle
CordovaLib 文件夹的内部,错误消失了。
回答by Azurai
I have just recently updated my android studio to 0.6.0, and it was giving me the same problem. But my build was 19.0.3, instead of 19.1.0. I changed the buildToolsVersion "19.0.3" to --> "19.1.0" which it forced the Gradle to download the updates. I restarted my Android Studio, and the error went away. Not sure exactly how to explain, but I think it forces it to download the patch off the Maven site, and does its justice behind scenes. And just as Gabriel Matusevich said, the build.gradle is located ProjectFolder -> AppFolder -> build.gradle
我最近刚刚将我的 android studio 更新到 0.6.0,它给了我同样的问题。但是我的版本是 19.0.3,而不是 19.1.0。我将 buildToolsVersion "19.0.3" 更改为 --> "19.1.0",这迫使 Gradle 下载更新。我重新启动了我的 Android Studio,错误消失了。不确定如何解释,但我认为它迫使它从 Maven 站点下载补丁,并在幕后进行公正处理。正如 Gabriel Matusevich 所说,build.gradle 位于 ProjectFolder -> AppFolder -> build.gradle
Exception: I havn't completed tested this out, but I did notice the Gradle was downloaded from the site, I havn't added or deleted code, or ran the application yet. So to be sure, remember the buildToolsVersion number you had before!
例外:我还没有完成测试,但我确实注意到 Gradle 是从站点下载的,我还没有添加或删除代码,也没有运行应用程序。所以可以肯定的是,记住你之前的 buildToolsVersion 号!
回答by Jorge Vieira
Open Android SDK Manager and make sure you have Build Tools 19.1 downloaded. Double-check.
打开 Android SDK Manager 并确保您已下载 Build Tools 19.1。再检查一遍。
Then find build/app.gradle and change buildToolsVersion number to '19.1':
然后找到 build/app.gradle 并将 buildToolsVersion 编号更改为“19.1”:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1'
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
}
回答by Michael
I fixed this issue by going into myAppProject/actionbarsherlock/build.gradle
and changing
我通过进入myAppProject/actionbarsherlock/build.gradle
和更改解决了这个问题
android {
compileSdkVersion 14
buildToolsVersion '17.0.0'
to this
对此
android {
compileSdkVersion 14
buildToolsVersion '19.1.0'
回答by RoQ
Hi for me after download the last version of the android SDK Tools, I change the android version F4 (Module Settings)
嗨,下载最新版本的 android SDK 工具后,我更改了 android 版本 F4(模块设置)
https://www.dropbox.com/s/9ypuepxfwlcp4e5/Captura%20de%20pantalla%202014-06-10%2000.45.38.png
https://www.dropbox.com/s/9ypuepxfwlcp4e5/Captura%20de%20pantalla%202014-06-10%2000.45.38.png
回答by Gabriel Matusevich
I found the problem, build.gradle was on the wrong folder
我发现了问题,build.gradle 在错误的文件夹中
回答by Dhnjy Patil
I had the same problem. This is what me solved this problem.
我有同样的问题。这就是我解决这个问题的方法。
Step 1:Go To SDK Manager
第 1 步:转到 SDK 管理器
Step 2:Upgrade your Android sdk Build-Tool From current to updated version. (In my case am upgrade it to 21.1.2)
第 2 步:将您的 Android sdk 构建工具从当前版本升级到更新版本。(就我而言,我将其升级到 21.1.2)
Step 3:Rebuild your application.
第 3 步:重建您的应用程序。
This Steps Solved My Problem. Hope it solves your problem too.
这个步骤解决了我的问题。希望它也能解决你的问题。
回答by Optimus Krish
I too faced the same problem and the fix was so simple. Just launch android SDK manager and check the latest build tools. Finally click on install packages which were selected. Now restart the IDE and try building the project.
我也遇到了同样的问题,解决方法很简单。只需启动 android SDK 管理器并检查最新的构建工具。最后点击选择的安装包。现在重新启动 IDE 并尝试构建项目。
回答by AmmAr Yasser
change in build.gradle "project: layout xml " code >>
build.gradle“项目:布局xml”代码中的更改>>
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}allprojects {
repositories {
jcenter()
enter code here}
}
}allprojects {
repositories {
jcenter()
在此处输入代码}
}