I\'m trying to make jacoco create a code coverage report for my android test project. I have the following in build.gradle:
apply plugin: \'com.android.appli
Now (Oct 2015) you can use it as android team has fixed the bug.
android {
...
buildTypes {
debug {
testCoverageEnabled true
}
}
...
dependencies{
androidTestCompile 'com.android.support.test:runner:0.4.1'
// Set this dependency to use JUnit 4 rules
androidTestCompile 'com.android.support.test:rules:0.4.1'
// Set this dependency to build and run Espresso tests
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
}
}
Then just use ./gradlew createDebugCoverageReport
.