Gradle继续询问更新和降级?

时间:2014-01-12 07:36:34

标签: gradle android-studio

我继续收到“Gradle Sync错误”,所以我查了1.8版本。更新到1.10,然后它说我需要1.9,所以我降级到1.9它说我需要1.8,当我降级到1.8它说我需要1.9。

15:28:09 Failed to refresh Gradle project 'Calendar'
         You are using Gradle version 1.8, which is not supported. Please use version 1.9.
         Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
         Fix Gradle wrapper and re-import project Gradle settings
15:28:26 Failed to refresh Gradle project 'Calendar'
         You are using Gradle version 1.10, which is not supported. Please use version 1.9.
         Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
         Fix Gradle wrapper and re-import project Gradle settings
15:28:39 Failed to refresh Gradle project 'Calendar'
         Gradle version 1.8 is required. Current version is 1.9. If using the gradle wrapper, try editing the distributionUrl in
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android
Studio\gradle\wrapper\gradle-wrapper.properties to gradle-1.8-all.zip.
         Please fix the project's Gradle settings.

1 个答案:

答案 0 :(得分:10)

AS还不支持Gradle 1.10,Android Tools开发团队正在开发它,可能会在下一版本中提供。

截至目前,使用gradle 1.9作为依赖项

确保项目中的所有build.gradle文件
  buildscript {
      repositories {
        mavenCentral()
      }
  dependencies {
      classpath 'com.android.tools.build:gradle:0.7.+'
     }
  }

更新:

在版本0.4.3之后Android Studio中现在支持Gradle 1.10,所以你可以在类路径中使用0.8.+开始使用1.10插件

classpath 'com.android.tools.build:gradle:0.8.+'