Versions used:
Sonarqube 7.2, Gradle Plugin 2.6.2, Android Studio 3.1.3, Gradle 4.6, Multi-Project configuration
Error Observed:
Sonarqube scanner throws “Classes not found during the analysis…” error or “Missing blame information for the following files:…” while analysing a gradle module with an implementation dependency.
Steps to reproduce:
- Make a Gradle Library Module or just a Gradle Module and add an implementation dependency in its dependencies section.
- Create a class in the module that make use of this dependency.
- Then run “gradle sonarqube” on the project.
- Sonarqube runner will warn it cannot find any of the dependency classes
Any of these won’t work:
- implementation “com.google.firebase:firebase-core:11.8.0”
- ext.libs = [
firebase_base : “com.google.firebase:firebase-core:17.0.0”,
]
implementation libs.firebase_base - implementation fileTree(dir: ‘libs’, include: [’*.jar’])
- implementation project(’:Libs:myLibrary’)
- implementation(project(’:Libs:myLibrary’)) {
exclude module: ‘myBaseLibrary’
} - implementation project(’:AARs:aarLibrary’) //being aarLibrary an AAR module
Being these inside the dependencies section of build.gradle file:
dependencies {
implementation …
}
Potential workaround:
SonarQube Runner Plugin for Gradle should take into account dependencies setted by implementation term. Although changing them to “api” configuration will work but also increases building time. Implementation configurations where conceived to reduce building time.