I have a `lint.gradle` file in my android project ...
# gradle
v
I have a
lint.gradle
file in my android project which I want to convert to a
.kts
file. Here's what the 2 versions look like
Copy code
// .kts version
android {
    lintOptions {
        isAbortOnError =true
        xmlReport =false
        setLintConfig(file("$rootDir/codeQuality/lint.xml"))
    }
}

// groovy version
android {
    lintOptions {
        abortOnError true
        lintConfig file("$rootDir/codeQuality/lint.xml")
        xmlReport false
    }
}
The groovy version works fine but in the kts version I keep getting unresolved reference issues
Line 1: android { ^ Unresolved reference: android
. Any ideas on how I can resolve this?
g
You don't have generation of type-safe accessors in scripts (including
android
). you have them only when you have
plugins
block: build.gradle.kts or precompiled script plugins. Check official Kotlin DSL primer it's explains why and how to manage build logic