我刚刚更新了我的Android Studio到版本3.0 Canary 1, 现在我正在使用Android Studio 3.0 Canary 1来继续开发我的现有项目。 默认情况下,我的项目gradle文件中设置了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
}