运行错误 提示 Gradle DSL method not found: 'execute()'
来源:8-7 挂接自定义Task到构建过程中

qq_蓝城_1
2020-07-24
this.project.afterEvaluate {project->
project.tasks.getByName(“clean”).doLast {MyTask.execute()}
}
task MyTask{
println "mytask"
doLast {
println “mytask dolast”
}
}
提示如下:
Gradle DSL method not found: 'execute()'
Possible causes:
The project ‘AUGUS_APP’ may be using a version of the Android Gradle plug-in that does not contain the method (e.g. ‘testCompile’ was added in 1.1.0).
Upgrade plugin to version 4.0.1 and sync project
The project ‘AUGUS_APP’ may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin
写回答
1回答
-
qndroid
2020-07-24
新版本,没有这个方法了。
022020-07-28
相似问题