2014-01-12 38 views
8

我不斷收到「Gradle Sync錯誤」,所以我檢查了版本1.8。更新到1.10,那麼它說我需要1.9,所以我降級到1.9它說我需要1.8,當我降級到1.8它說我需要1.9。Gradle不斷要求更新和降級?

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. 
+0

很可能y在程序中使用不同版本的功能或插件,使版本兼容性不一致。 –

回答

10

AS尚未支持Gradle 1.10,因此Android Tools Developer團隊正在開發它,並可能在下一版本中提供。

截至目前確保使用gradle這個1.9項目中的所有您的build.gradle文件作爲依賴

buildscript { 
     repositories { 
     mavenCentral() 
     } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:0.7.+' 
    } 
    } 

更新:

搖籃1.10現在支持Android Studio中釋放0.4之後。 3,所以今後你可以在類路徑中使用0.8.+這樣開始使用1.10插件,像這樣

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

這裏的版本如何?對於1.10 - 使用0.8。+? – ShashiKant

+0

0.8是由Android Tools團隊開發的Andr oid Gradle插件版本,開發對應於1.10版本的Gradle。現在Android gradle插件0.9可以使用Gradle 1.11運行。 – pyus13