我刚刚将我的 Android Studio 更新到 3.0 canary 1。现在我正在处理我在 Android Studio 3.0 canary 1 上的现有项目。默认情况下,我的项目中设置了gradle:3.0.0-alpha1:gradle_file。所以我将我的 gradle 版本更改为 2.2.3,现在我收到了这个错误:
错误:无法完成 Gradle 执行。
原因:您使用的 Gradle 版本 (3.3) 不支持 BuildActionExecuter 上的 forTasks() 方法。Gradle 3.5 和所有更高版本都提供了对此的支持。
我在这里附上了我的 gradle 文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}