Declaring custom ‘clean’ task when using the standard Gradle lifecycle plugins is not allowed
You should not try to override the default clean task, but instead configure it to delete additional stuff like clean { delete rootProject.buildDir } But check first whether this is not the default behavior of the clean task anyway. Alternatively if you want to be able to do a specific clean action individually, you can … Read more