Android Studio 说要使用 Gradle 1.10 - 但新版本是 1.12? [英] Android Studio says to use Gradle 1.10 - but new version is 1.12?
问题描述
错误:
The project is using an unsupported version of Gradle. Please use version 1.10.
My `gradle.build` file says this:
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
据我所知,上面这行是正确的.我的 gradle-wrapper
文件说:
As far as I know, the above line is correct. My gradle-wrapper
file says:
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
当我下载最新的 Android Studio 测试版 (v.8) 并尝试导入一个我认为是旧版 Gradle 的应用程序时,就会发生这种情况.
This happened when I downloaded the newest Android Studio beta (v.8) and tried to import an app that had, what I assume is an old version of Gradle.
此外,当我点击Fix Gradle Wrapper and re-import project
"时,没有任何反应.
Also, when I hit "Fix Gradle Wrapper and re-import project
", nothing happens.
推荐答案
如果你想把 gradle-wrapper 改成低版本你必须把 distributionUrl 改成
If you want to change the gradle-wrapper to a lower version you have to change distributionUrl to
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
然后重新运行包装器任务.如果这还不够,只需删除文件夹 .gradle
和 gradle
以及文件 gradlew
和 gradlew.bat
.重新运行包装器,他下载了 grade 1.10
and then rerun the wrapper task. If this isn't enough just delete the folders .gradle
and gradle
and the files gradlew
and gradlew.bat
.
The rerun wrapper and he downloads gralde 1.10
由于 gradle 对 1.10 和 1.12 版本的 API 进行了一些重大更改,因此您无法使用更高版本构建任何项目,因此构建插件.因此,如果 android 插件是使用 gradle 1.10 构建的,则必须使用相同的版本
Since gradle had some major api changes from version 1.10 and 1.12 you can not build any project with a higher version then the plugins are build with. So if the android plugin is build with gradle 1.10 you have to use the same version
这篇关于Android Studio 说要使用 Gradle 1.10 - 但新版本是 1.12?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!