2014-11-05 125 views
1

有幾十個教程如何修復錯誤The project is using an unsupported version of Gradle.,但它們都不適用於我。我總是得到一個錯誤:無論我做什麼,我總是得到「不支持的Gradle版本」

The project is using an unsupported version of Gradle. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)

,它甚至沒有說哪個搖籃,我應該使用哪些其他人相處!

我使用過Android Studio 0.9.1,我試圖打開一個搖籃項目,該項目是依賴於搖籃0.12 +(在build.gradle行說

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

我改變了這classpath 'com.android.tools.build:gradle:0.14.+'但仍然有同樣的錯誤。

然後我去<project>/gradle/wrapper和編輯文件gradle-wrapper.propertiesdistributionUrl=http\://services.gradle.org/distributions/gradle-1.14-all.zip。這也沒有幫助。

然後我去每個子目錄,發現所有build.gradle文件,包括Facebook和其他庫這樣的文件,並改了行:

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

但是這也不能工作。

所以我現在無能爲力,因爲所有的教程都提出了我試過的解決方案。

爲什麼我不能導入這個項目?我在哪裏犯錯誤?

+0

我不認爲這是你的問題,但你應該使用'apply plugin:'com.android.application''來代替'apply plugin:'android'' – 2014-11-05 19:23:07

回答

0

gradle插件的'0.14。+'版本需要Gradle 2.1,如the official docs中所述。看來你試圖用1.14

distributionUrl=http\://services.gradle.org/distributions/gradle-1.14-all.zip 

這是不兼容的。

解決問題的最簡單方法是下載Gradle 2.1並直接運行構建,或者將包裝器更改爲使用2.1而不是1.14。

相關問題