我刚刚将Android Studio更新为3.0 canary1。现在,我正在Android Studio 3.0 canary 1上处理现有项目。默认情况下,在我的项目gradle_file中设置了gradle:3.0.0-alpha1。所以我将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
}


