Getting Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed. in Gradle-4.2.1

I am migrating my project to use Multi-project structure.

My project structure

-root
-Project1
-build.gradle

-Project2 
-build.gradle
    -Subproject1
    -build.gradle
    -Subproject2
    -build.gradle
    -Subproject3
    -build.gradle

I have written a task clean in my subproject(Subproject1/build.gradle). I want to delete the folder build in Subproject2 and Subproject3.

But I am getting below exception message.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘D:\User\workspace\root\Project2\Subproject1\build.gradle’ line: 12

  • What went wrong:
    A problem occurred evaluating project ‘:Project2:Subproject1’.

Declaring custom ‘clean’ task when using the standard Gradle lifecycle plugins is not allowed.

Can you please suggest me how to fix this issue and reason for this error message?