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
6m Okay, I get an error in Gradle that it cannot clean the root project file.
:25 AM Gradle sync failed: Declaring custom ‘clean’ task when using the standard Gradle lifecycle plugins is not allowed.
error code info-ide.actionsShowFilePathAction Exit Code 1
Clean Triggers nom run clean dependsOn"npmInstall"
In the Gradle doc 4.7 The Project in the directory where the Build is executed is also configured but only when Gradle is executed without any tasks. This way the default tasks behave correctly when projects are configured on demand.
Configuration on demand Gradle 4.6 Android plugin for Gradle 3.01 or 3.1.0 with Gradle Gradle properties file org.gradleconfigureondemand=false
So what I did was to comment out the task clean and now I get a build that words,
I think what happened is that this script works if you had built and modified the project. When you download the project you have not built it for the first time. Therefore there is no Root Project Path to clean as it has never been built yet. This causes it to fail. By commenting it out the first time you don’t get the error.
Here is the code. // Top-level build file where you can add configuration options common to all sub-projects/modules.
` buildscript { ext.kotlin_version = ‘1.2.41’
ext.support_version = '26.1.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: ‘kotlin’
allprojects {
repositories {
google()
jcenter()
}
}
/*
task clean(type: Delete) {
delete rootProject.buildDir
} */
'
tools>kotlin>configure in the project you have to select Android Gradle not gradle