Gradle error in Android Studio 0.4.3

时间秒杀一切 提交于 2020-01-11 12:04:27

问题


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)

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

Any ideas?


回答1:


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.+'
}

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.



来源:https://stackoverflow.com/questions/21441204/gradle-error-in-android-studio-0-4-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!