I have a top level Android Gradle project. There are multiple subprojects nested below this projects (sometimes they are 2 level deep) i.e:
top level project
I too faced a similar situation, but instead of just modifying the DSL directly, I called configure on it instead:
configure(android.lintOptions) {
abortOnError false
}
As a result, I was able to disable abortOnError for my desired subprojects. Bottom line, your subproject block should look like this:
subprojects {
afterEvaluate {
if (getPlugins().hasPlugin('android') ||
getPlugins().hasPlugin('android-library')) {
println name // for debugging
configure(android.lintOptions) {
abortOnError false
}
}
}
}