Android Studio 0.4.3 中的 Gradle 错误 [英] Gradle error in Android Studio 0.4.3

查看:31
本文介绍了Android Studio 0.4.3 中的 Gradle 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在旧版本中找到了对此的引用,但不是最新版本.我将 Android Studio 更新到 0.4.3 并创建了一个新项目.构建立即失败并显示以下内容:

I found references to this with an older version, but not the most recent. I updated Android Studio to 0.4.3 and created a new project. The build fails immediately with the below:

Could not create an instance of Tooling API implementation using the specified Gradle distribution 'http://services.gradle.org/distributions/gradle-1.10-all.zip'.: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'http://services.gradle.org/distributions/gradle-1.10-all.zip'.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'http://services.gradle.org/distributions/gradle-1.10-all.zip'.
    at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:185)

我已尝试安装 JDK 1.7 并将我的 JAVA HOME 设置为该版本(以前是 1.6),但发生了同样的错误.我的 GradleWrapper.properties 是:

I have tried installing JDK 1.7 and setting my JAVA HOME to that (previously was 1.6) but the same error occurs. My GradleWrapper.properties is:

#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip

有什么想法吗?

推荐答案

您需要确保使用正确版本的 Android Gradle 插件.对于 Android Studio 0.4.3,它是 0.8.X 系列.在 build.gradle 中将其指定为:

You need to make sure you're using the correct version of the Android Gradle plugin. For Android Studio 0.4.3 it's the 0.8.X series. Specify it in build.gradle as:

dependencies {
    classpath 'com.android.tools.build:gradle:0.8.+'
}

这可能在顶层 build.gradle 或你的模块中;在更高版本的 Android Studio 中新创建的项目中,我们放置它的位置发生了变化.

This may be in the top-level build.gradle or the one in your module; the location where we put this has changed in projects newly created in later versions of Android Studio.

这篇关于Android Studio 0.4.3 中的 Gradle 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆