我正在向jCenter添加一個庫,因此我需要將一些插件添加到我的項目的build.gradle文件中。不過,我得到錯誤當使用標準的Gradle生命週期插件時,聲明自定義的「乾淨」任務是不允許的
Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed.
我可以看到task clean
塊,當我刪除了錯誤消失。我認爲這就是我需要做的,但是它之前做了些重要的事情嗎?如果我在某個時候刪除插件並忘記將clean
塊添加回來,那麼存儲的可怕後果是什麼?
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
id "com.github.dcendents.android-maven" version "1.5"
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
結賬this link。一切都在其中解釋。當然這會有所幫助! –