我从〜/ .gradle删除了与gradle 1.1相关的任何内容,但出现错误:
Error:Gradle version 1.10 is required. Current version is 2.0. If using the gradle wrapper, try editing the distributionUrl in /home/alex/Documents/projects/android/MyApp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip.
我的设置是(在我从项目中删除/ gradle之前):
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-all.zip
现在在File-> Settings-> Gradle中,我有这个:
Use local gradle distribution -> /usr/local/gradle/gradle-2.0
该文件安装在该文件夹中,并且版本为2.0。
那怎么了?
这是
build.gradle
apply plugin: 'scala'
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "http://saturday06.github.io/gradle-android-scala-plugin/repository/snapshot"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.0-SNAPSHOT"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
最佳答案
Android Gradle插件当前与Gradle 2.0不兼容。最新的AOSP分支支持2.0,因此Gradle插件的下一版本可能也将支持2.0(source)。
我建议切换回包装器并在gradle-wrapper.properties中设置distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
。
或者,将本地Gradle版本切换为1.10-1.12。
关于android - 无法使用Gradle 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25646539/