10

Android: Jacoco code coverage is not generating after gradle upgrade to 7.0.x & jdk 11 with testCoverageEnabled true. It is working perfect with gradle 4.2.x & jdk 8.

I tried removing testCoverageEnabled true with gradle 7.0.x & it again started working. It will work even if set it to false (testCoverageEnabled false). But the jacoco document says mark it as true only to generate test coverage report.

with gradle 4.2 and jdk 8 it worked fine & now with gradle 7.0 and jdk 11 it's working after removing the boolean.

can anyone help me to understand a more on this that how it is working if removed testCoverageEnabled true or it set to false?

Akshay
  • 111
  • 5
  • I have the same issue, I had it as true in the .gradle and jacoco didn't even create the merged reports folder. Turning this to false it generates a merged report only for junit test and not android test. So still missing a part of the coverage. – Jim_Ktr Feb 04 '22 at 16:32
  • 1
    Really sorry I can't understand/answer why removing `testCoverageEnabled` works, but your question has actually solved our problem of the jacoco reports not generating. We've tried so many things, and this is the only thing that worked. So big thank you! – dev2505 May 18 '22 at 20:44

1 Answers1

0

In case anyone misses the comment by dev2505, removing testCoverageEnabled completely, appears to fix this.

Alt-Cat
  • 5,392
  • 1
  • 15
  • 16