最近在一个新的项目BUILD过程中遇到了这个问题
Error:Execution failed for task ‘:app:clean’.
Unable to delete directory:**
我的studio是2.3.3
之前我也遇到过类似问题 之前的解决方法是在app:build文件中加入了
task clean(type: Delete) {
delete rootProject.buildDir
}
但是这次加上去之后好像并没有什么用 又出现了一个新的问题
Error:(23, 0) Declaring custom ‘clean’ task when using the standard Gradle lifecycle plugins is not >allowed.
Open File
最后查找各种资料 然后发现overflow上有一个文章贴出了解决办法,把上面代码换成下面的:
clean {
delete rootProject.buildDir
}
我亲测是build成功了 ,mark一下,希望能够帮到遇到相同问题的伙伴.
overflow原文地址
https://stackoverflow.com/questions/43933459/declaring-custom-clean-task-when-using-the-standard-gradle-lifecycle-plugins-i