Create new Android project with Android Gradle Plugin at least 7.2.0
Add the library dependency
Enable test coverage in build.gradle:
buildTypes {
debug {
testCoverageEnabled true
}
}
Run a coverage report task:
./gradlew createDebugCoverageReport
Result:
> Task :app:mergeExtDexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform emoji-google-0.10.0.aar (com.vanniktech:emoji-google:0.10.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JacocoTransform: /home/alvaro/.gradle/caches/transforms-3/4e20d048f2e778a489fe8d3a9b9c3c9c/transformed/emoji-google-0.10.0-runtime.jar.
> org.gradle.internal.operations.BuildOperationInvocationException (no error message)
Reproduction steps:
build.gradle
:Result:
Notes
Sample project for reproduction attached: EmojiGoogleTest2.zip
Versions 0.9.0 and below are unaffected. We've had to roll the library back in our repo.