2

Project build.gradle:

buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
    ...
}

gradle-wrapper:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

library-module build.gradle dependencies:

dependencies {
    compileOnly "com.android.tools.lint:lint-api:26.6.3"
//    compileOnly "com.android.tools.lint:lint-checks:26.6.3"
    testImplementation "com.android.tools.lint:lint-tests:26.6.3"
}

If I run gradle assemble:

Execution failed for task ':lint-rules:compileDebugKotlin'.

Could not resolve all artifacts for configuration ':lint-rules:debugCompileClasspath'. Failed to transform artifact 'common.jar (com.android.tools:common:26.6.3)' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. Execution failed for JetifyTransform: /Users/.../.gradle/caches/modules-2/files-2.1/com.android.tools/common/26.6.3/660d537bd70cc816f63b4b038a529177f402448a/common-26.6.3.jar. Failed to transform '/Users/.../.gradle/caches/modules-2/files-2.1/com.android.tools/common/26.6.3/660d537bd70cc816f63b4b038a529177f402448a/common-26.6.3.jar' using Jetifier. Reason: The given artifact contains a string literal with a package reference 'android.support.design.widget' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.. (Run with --stacktrace for more details.)

If I uncomment the lint-checks import it adds:

Failed to transform '/Users/.../.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-checks/26.6.3/aa1f7a4caa8cbc70f85e4c97409270ce7d7a7eab/lint-checks-26.6.3.jar' using Jetifier. Reason: duplicate entry: NOTICE. (Run with --stacktrace for more details.)

I've tried to disable Jetifier but it's worst. I've tried to exclude the tools:common from lint and import manually but it doesn't work either.

I'm stuck here, what am I missing?

GuilhE
  • 10,723
  • 13
  • 63
  • 94

1 Answers1

1

I've found out the issue, my build.gradle was using apply plugin: 'com.android.library' instead of java-library '^^

GuilhE
  • 10,723
  • 13
  • 63
  • 94