Closed
Description
Steps to reproduce
- JaCoCo version:
v0.8.13
- Operating system: Ubuntu 24.04.2 LTS
- Tool integration: CLI (via Gradle plugin in Android project)
- Complete executable reproducer: https://github.com/waffiqaziz/example-mockito-jacoco
- Steps:
- Clone the repository
- Update Mockito Android and Mockito Core to
v5.18.0
(which uses Byte Buddyv1.17.5
) - Run instrumentation tests with:
./gradlew connectedDebugAndroidTest
Expected behaviour
Instrumentation tests should run successfully and JaCoCo should generate code coverage data without any class transformation issues.
Actual behaviour
Instrumentation tests fail due to a JaCoCo transformation issue involving Byte Buddy. Gradle throws the following error:
Execution failed for task ':app:connectedDebugAndroidTest'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath'.
> Failed to transform byte-buddy-1.17.5.jar (net.bytebuddy:byte-buddy:1.17.5) to match attributes {artifactType=jacoco-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JacocoTransform: /home/runner/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.17.5/88450f120903b7e72470462cdbd2b75a3842223c/byte-buddy-1.17.5.jar.
Additional information
- Tested with Mockito
v5.18.0
(uses Byte Buddyv1.17.5
) – ❌Fails (tested in my runner) - Tested with Mockito
v5.17.0
(uses Byte Buddyv1.15.11
) – ✅ Passes (tested in my runner)
This suggests the issue is likely related to a change in Byte Buddy between v1.15.11
and v1.17.5
that conflicts with JaCoCo's class transformation.