最近在一個新的項目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