在cmd中使用gradle构建失败

时间:2013-11-13 12:38:28

标签: android-gradle

错误消息

Error listing versions of com.android.tools.build:gradle:0.4+ using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. Will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in Gradle 2.0

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'TestMain'.
> Could not resolve all dependencies for configuration ':classpath'.

   > Could not resolve com.android.tools.build:gradle:0.4+.

     Required by:

       :TestMain:unspecified
> Failed to list versions for com.android.tools.build:gradle:0.4+.

      > Could not list versions using M2 pattern 'http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
'.
            > Could not GET 'http://repo1.maven.org/maven2/com/android/tools/bui
ld/gradle/'.
               > Connection to http://repo1.maven.org refused

我使用的是不正确的sdk吗?

1 个答案:

答案 0 :(得分:0)

您可以按照本教程进行操作。

http://www.vogella.com/articles/AndroidBuild/article.html

然后关闭防火墙和防病毒软件。