Severiano Jaramillo
09/01/2023, 11:45 PMdependencies {
compileOnly("com.android.tools.lint:lint-api:lint-version")
compileOnly("com.android.tools.lint:lint-checks:lint-version")
testImplementation("com.android.tools.lint:lint-tests:lint-version")
testImplementation(libs.kotlin.test.junit)
}
Cannot access class 'com.android.tools.lint.detector.api.Issue'. Check your module classpath for missing or conflicting dependencies
Basically, unit tests cannot resolve dependencies that are configured with compileOnly
. That used to work before migrating to Kotlin 1.9+. I found a way to fix the problem by adding the below configuration block:
configurations {
// Give tests visibility into dependencies configured as compileOnly
testImplementation.extendsFrom(compileOnly)
}
Does anyone know why Kotlin 1.9+ would cause this issue? Is my configurations block the correct way to solve it?
Thanks!agrosner
09/01/2023, 11:56 PMagrosner
09/01/2023, 11:57 PMagrosner
09/01/2023, 11:57 PMSeveriano Jaramillo
09/01/2023, 11:57 PMlint
module is depended on using lingChecks
agrosner
09/01/2023, 11:58 PMagrosner
09/01/2023, 11:59 PMSeveriano Jaramillo
09/02/2023, 12:03 AMSeveriano Jaramillo
09/02/2023, 12:03 AMagrosner
09/02/2023, 12:08 AMSeveriano Jaramillo
09/02/2023, 12:10 AMChrimaeon
09/02/2023, 9:22 AMChrimaeon
09/02/2023, 9:23 AMColton Idle
09/02/2023, 1:51 PMSeveriano Jaramillo
09/02/2023, 9:05 PMSeveriano Jaramillo
09/05/2023, 7:56 PMtestImplementation("com.android.tools.lint:lint:lint-version")
dependency.
I wonder why that only became a problem when I migrated to Kotlin 1.9+ and not before 🤔