I'm trying to get jacoco create a code coverage report for my android test project.
Gradle version classpath 'com.android.tools.build:gradle:2.0.0'
I have the following in build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.1.201405082137"
}
android {
buildTypes {
release {
}
debug {
testCoverageEnabled true
}
}
}
It shows report as below image
There is almost 95% of the code coverage (When I ran the same report in 2015 it showed the report as 95%). Nothing much changed in the code and the test folders ever since then. So ideally it should show coverage as something like this
I tried running report with both JDK7 & 8 but same result. Also tried changing to latest versions of JaCoCo, but still same result.
Any ideas why the report is shown as 0% coverage? While running the Gradle task it runs my tests in androidTest folder successfully though.
Facing same issue as mentioned in this question - This question is unanswered yet