Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Found more than one jar in the 'lintChecks' configuration

I want to add custom lint rules to my projects, but I get error while syncing project.

Execution failed for task ':app:prepareLintJar'.


Found more than one jar in the 'lintChecks' configuration. Only one file is supported. If using a separate Gradle project, make sure compilation dependencies are using compileOnly

How can I check which library or module is adding another jar?

like image 866
Valgaal Avatar asked Jan 30 '20 09:01

Valgaal


1 Answers

I fixed problem. My dependencies in my custom rules module was

dependencies {
    api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    compileOnly 'com.android.tools.lint:lint-api:26.5.3'
    compileOnly 'com.android.tools.lint:lint-checks:26.5.3'
}

I changed kotlin dependency to compileOnly and it worked

dependencies {
    compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    compileOnly 'com.android.tools.lint:lint-api:26.5.3'
    compileOnly 'com.android.tools.lint:lint-checks:26.5.3'
}
like image 179
Valgaal Avatar answered Sep 20 '22 00:09

Valgaal