SonarQube Scanner cannot find the XML Jacoco coverage report

We run the sonarqube task from gradle but it cannot find the jacoco coverage report even though the XML file has already been generated.

Here is log:


No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='build/reports/coverage/coverage.xml,app/build/reports/coverage/coverage.xml,**/reports/coverage/coverage.xml,reports/coverage/coverage.xml'. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml

The jacoco xml report file has been generated under build folder


$ echo $(ls app/build/reports/coverage)
coverage.xml

Hi,

Welcome to the community!

Where do you run analysis from? What are the subdirectories analysis “sees”?

 
Ann

Hi Ann,

I use GitLab CI to run the analysis for android project. You can see the build folder structure has been created as following:

project_dir/app/build/reports/coverage/coverage.xml

Hi,

I actually meant to ask what directory analysis is executed from. Could you add -Dsonar.log.level=DEBUG to your command line and post your analysis log?

 
Ann

Hi Ann,

I already found the problem and get it work already. Thank you for your support.

Thanks,

Hi,

I’m glad you worked through this. Did you learn anything that might help others in the future?

 
Thx,
Ann