lintOptions deprecated , What is the alternative?

1.6k views Asked by At

I have upgraded Android Gradle Plugin to 7.4.

Now getting warning lintOptions are deprecated.

lintOption Deprecated

What alternative is to be used for this?

1

There are 1 answers

2
Rumit Patel On

We can use the new Lint block.

The old lintOptions block is deprecated in Android Gradle Plugin 7.2 and replaced by the new Lint block. We can simply replace it and use it in the app-level build.gradle file like the below example.

Groovey Example:

lint {
    disable 'MissingTranslation', 'TypographyFractions'
    abortOnError false
    checkReleaseBuilds false
}

Kotlin DSL Example:

lint {
    disable += "MissingTranslation" + "TypographyFractions"
    abortOnError = false
    checkReleaseBuilds =  false
}

Most of the properties are the same as previously but you can check Summary, Public properties, and Configure lint options with Gradle.