找不到方法lintChecks()

时间:2019-06-10 16:26:55

标签: gradle android-gradle build.gradle gradle-plugin

当我将lintChecks project(':checks')添加到模块的build.gradle时,如下所示:

apply from: "$rootDir/dependencies.gradle"

apply plugin: 'kotlin'

dependencies {
    lintChecks project(':checks')

    // Libraries
    implementation libs.arrow.core
    implementation libs.javaxInject
    implementation libs.kotlin.stdlib
    implementation libs.moshi.core
    implementation libs.moshi.adapters
    implementation libs.rxjava.core
    implementation libs.rxjava.kotlin

    // Test Dependencies
    testImplementation libs.truth
    testImplementation libs.spek.dsl
    testRuntimeOnly libs.spek.runner
}

test {
    useJUnitPlatform {
        includeEngines 'spek'
    }
}

我收到:

Could not find method lintChecks() for arguments [project ':checks'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

有人知道什么可以解决这个问题吗?我正在尝试实施自定义棉绒检查,并且一直遵循Google code examples到发球台。

1 个答案:

答案 0 :(得分:0)

我尝试使用内置的'lint-checks',并且我也遇到了类似的错误。 但是当我使用lintPublish时,它起作用了。

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:leanback-v17:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    lintPublish 'com.android.tools.lint:lint-checks'
}