I have found a temporary workaround. Just specify the system property:
testOptions {
unitTests {
all {
systemProperty 'jacoco-agent.destfile', buildDir.path + '/jacoco/tests.exec'
}
}
}
or add a file jacoco-agent.properties file with destfile=build/jacoco/tests.exec content in the library project under debug/resources/ folder.
My reproducible project: https://github.com/DenysShovhenia/Test
Steps to reproduce:
- Open project in Android Studio
- Run testDebugUnitTest task of Test(root) module
- Note the newly created jacoco.exec file in the root folder of app module
Gradle version: 4.1.0
Android Plugin Version: 3.0.1
Module Compile Sdk Version: 26
Also, I have found a similar open issue here: https://issuetracker.google.com/issues/67872367
androidJacocoAgent - The Jacoco agent to use to get coverage data.
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128
androidJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.
\--- org.jacoco:org.jacoco.ant:0.7.4.201502262128
+--- org.jacoco:org.jacoco.core:0.7.4.201502262128
| \--- org.ow2.asm:asm-debug-all:5.0.1
+--- org.jacoco:org.jacoco.report:0.7.4.201502262128
| +--- org.jacoco:org.jacoco.core:0.7.4.201502262128 (*)
| \--- org.ow2.asm:asm-debug-all:5.0.1
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128