- Sonar Developer Edition v2025.1.3 (110580)
- Sonar Gradle Plugin 6.3.1.5724
- Android Gradle Plugin 8.12.2
I’m trying to follow the advice from https://googlesamples.github.io/android-custom-lint-rules/user-guide.md.html#performancetuning/onlyanalyzeapp/leafmodules
If you have divided your project into many smaller modules — a number of libraries and just a couple of app modules — it’s much better to
Turn on checkDependencies mode, and
Only run lint on the app modules, instead of recursively running lint on each module.
To do this, first add this to your app module’s build.gradle file:
android { ... lintOptions { ... checkDependencies true ... } }Then instead of running
./gradlew lintDebug, run./gradlew :app:lintDebug.Since you’ve turned on check-dependencies mode, running lint on the app module will also run it on all the dependent modules the app depends on — e.g. all the libraries.
So I configured Sonar to import the reports from app modules instead of library modules:
subprojects { subproject ->
plugins.withId("com.android.application") {
sonarqube {
properties {
property "sonar.androidLint.reportPaths", ["build/reports/lint-results-prodLocalDebug.xml"]
}
}
}
But I don’t see issues from library modules in Sonar panel anymore. And I see some warnings in the logs such as:
Importing <PROJECT_PATH>/app/build/reports/lint-results-prodLocalDebug.xml
No input file found for <PROJECT_PATH>/lib-core/src/main/AndroidManifest.xml. No android lint issues will be imported on this file.
Is it possible to configure Sonar gradle plugin so that it works fine with checkDependencies true for Android Lint?