Gradle:Cannot add task ‘clean‘ as a task with that name already exists.

Gradle编译项目报错:Cannot add task 'clean' as a task with that name already exists.
提示的是gradle中的clean方法已经存在了,冲突了,把项目中build.gradle的clean方法注释掉或者删掉重新编译就也可以了。

buildscript {
  
    repositories {
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
    }
}

allprojects {
    repositories {
    }

// 注释或者删除掉
//    task clean(type: Delete) {
//        delete rootProject.buildDir
//    }
}

你可能感兴趣的:(开发工具,Android,gradle,android)