Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed

前端 未结 8 1673
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 09:02

I am adding a library to jCenter so to do that I needed to add some plugins to my project\'s build.gradle file. However, I am getting the error

Declar

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 09:47

    enter code hereallprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
    }
    

    }

    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    if you have added maven in your "build.gradle" then checkout all the brackets. The code should be as above. It should solve the problem. It is possible that brackets are placed in different places.

提交回复
热议问题