In my case somehow nice solutions was not working so I looked in the error file lint-results-debug.txt
and just disable errors that was actually not real issues in my code but more bugs of limited lint. Like this one:
.../Users/renetik/Development/renetik-instruments-android/project/renetik-instruments-library/src/main/res/layout/controller_chord.xml:9: Error: No orientation specified, and the default is horizontal. This is a common source of bugs when children are added dynamically. [Orientation]...
So I added to module build gradle of renetik-instruments-library
android {
...
lintOptions {
disable 'IncludeLayoutParam', 'Orientation', 'UseAppTint'
}
}
Now build works... and useful lint checks still there.
But also for build performance improvement of complex project this can be miracle:
afterEvaluate {
tasks.findAll { it.name.startsWith('lint') }.each { it.enabled = false }
}
But you have to place or included in each module build.gradle it doesn't work in project build.gradle
If its correctly aplied you can see
Task :renetik-instruments-app:lintVitalAnalyzeDebug SKIPPED
in Build Output console.