Gradle 错误:无法使用 gradle 分发执行构建 [英] Gradle error: could not execute build using gradle distribution
问题描述
在我将 Android Studio 更新到 0.2.7 版本后,出现以下错误:
After I updated Android Studio to version 0.2.7, I got the following error:
org.gradle.tooling.GradleConnectionException: Could not execute build
using Gradle distribution
'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.: Could
not execute build using Gradle distribution
'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
这是我的 build.gradle:
This is my build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 10
targetSdkVersion 17
}
}
有人知道这个错误吗?
推荐答案
我遇到了同样的问题,不能说我知道是什么原因造成的,但我刚刚关闭了 Android Studio,重命名了 c:\users\MY USERNAME\.gradle
目录到 old-.gradle
然后重新启动 Android Studio.
I had the same issue, can't say I know what caused it, but I just closed Android Studio, renamed the c:\users\MY USERNAME\.gradle
directory to old-.gradle
and then re-launched Android Studio.
Android studio 然后重新创建目录并自动下载 gradle zip 文件并进行设置.
Android studio then re-created the directory and automatically downloaded the gradle zip file and set it all up.
似乎一切都很好,但说实话,我不知道这个目录是什么,也不知道问题的根本原因是什么,所以请谨慎行事并保留旧的 .gradle
文件夹等一下,直到您满意为止,一切正常.
Seems to all be fine but to be honest I don't know what this directory is nor what the root cause of the problem was either, so proceed with caution and keep the old .gradle
folder around for a bit until you're happy all is working fine.
这篇关于Gradle 错误:无法使用 gradle 分发执行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!