which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Community Edition V 8.9.2 (build 46101);Android Gradle Plugin Version 3.6.2;Gradle Version 5.6.4
what are you trying to achieve
Implement Android Java scanning
what have you tried so far to achieve this
I configured the gradle plug-in to scan the Android project according to the introduction in the official document, and found that the build failed problem. If the project does not call the sonar parameter, it can build
At a glance, the issue doesn’t appear to be related to SonarQube.
> Task :app:processCustomDebugAndroidTestResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processCustomDebugAndroidTestResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.io.FileNotFoundException: D:\sonar-android\androidapp\app\build\intermediates\manifest_merge_blame_file\customDebugAndroidTest\manifest-merger-blame-custom-debug-androidTest-report.txt (œµÕ≥’“≤ªµΩ
÷∏∂®µƒŒƒº˛°£)
What changes did you make do your gradle configuration files to implement analysis? If you remove just those changes, does the build suddenly work again?
The error message you’re citing doesn’t appear in the log files shared. Is it possible you’re only passing stdout to the log files and not stderr as well?
Sorry, I forgot to enable the sonar plugin for the above logs. I have uploaded the logs again stacktrace.txt (33.2 KB)
I think the scanning failure is related to my multi-channel packaging with gradlew assembleCustomRelease. Is there any special configuration when the sonar plugin is adapted to multi-channel packaging?
Finally, I found that the scanning failed because of a task. I directly disabled these tasks in build.gradle that caused errors and successfully ran the scan,The specific code is as follows
gradle.taskGraph.whenReady {
tasks.each { task →
if (task.name.contains(“AndroidTestResources”) || task.name.contains(“minifyCustomReleaseWithR8”) || task.name.contains(“shrinkCustomReleaseRes”)) {
task.enabled = false
}
}
}