Android Lint Warnings Configure LintOptions with gradle

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can configure lint by adding a lintOptions section in the build.gradle file:

android {

    //.....

    lintOptions {
        // turn off checking the given issue id's
        disable 'TypographyFractions','TypographyQuotes'

        // turn on the given issue id's
        enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'

        // check *only* the given issue id's
        check 'NewApi', 'InlinedApi'

       // set to true to turn off analysis progress reporting by lint
       quiet true
 
       // if true, stop the gradle build if errors are found
       abortOnError false
   
       // if true, only report errors
       ignoreWarnings true
    }
}

You can run lint for a specific variant (see below), e.g. ./gradlew lintRelease, or for all variants (./gradlew lint), in which case it produces a report which describes which specific variants a given issue applies to.

Check here for the DSL reference for all available options.



Got any Android Question?