On my android project jacoco doesn't include the robolectic tests. I can get the android espresso and junit test coverage with jacoco without any issues.
I did see other questions about this issue and all the answers is to upgrade jacoco version. I'm using the latest jacoco version 0.7.9
This is my project main build.gradle
buildscript {
dependencies {
classpath 'org.jacoco:org.jacoco.core:0.7.9'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6-rc1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
App module build gradle.
apply plugin: 'jacoco'
android {
testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
includeAndroidResources = true
}
}
}