I have a Kotlin Multiplatform Mobile project and I...
# gradle
j
I have a Kotlin Multiplatform Mobile project and I am trying to write custom lint checks for android. I created a lint check module with the custom checks and not I am trying to add the module to the KMM library project module. The examples I have seen are just for normal android apps and using Groovy for their gradle files where I am using kotlin dsl so I am not sure what to do here but I tried to add the
lintPublish
to the
androidMain
dependencies like this
Copy code
val androidMain by getting {
            dependencies {
                lintPublish(project(":lint"))
                implementation("androidx.core:core-ktx:1.7.0")
                implementation("io.ktor:ktor-client-android:1.6.7")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
            }
        }
but the kotlin dsl does not recognize
lintPublish
. The exact error is
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
What am I doing wrong, do I place the lintPublish somewhere else? Does KMM work with custom lint checks?
k
If this is in the
shared
module that should be place in
android{}
block. I believe lint is packaged with the AGP.
Copy code
plugins{
    kotlin('multiplatform')
    id(com.android.library')
}

android {
    dependencies {
        lintPublish()
    }
}
173 Views