vanniktech / gradle-android-junit-jacoco-plugin

Gradle plugin that generates JaCoCo reports from an Android Gradle Project
http://vanniktech.com
Apache License 2.0
400 stars 76 forks source link

Update to jacoco 0.8.7 #195

Open ardevd opened 3 years ago

ardevd commented 3 years ago

Older Jacoco versions are incompatible with the Kotlin 1.5.x compiler. See this for more information.

However, setting jacocoVersion = '0.8.7'seems to crash tests.

trietbui85 commented 3 years ago

oh, can you share the crash log @ardevd ? I have plan to upgrade Kotlin to 1.5.0, thus will upgrade jacocoVersion = '0.8.7' too.

ilians commented 3 years ago

I had the same issue with crashing tests when updating to kotlin 1.5.0 or 1.5.10, for some reason upgrading to kotlin 1.5.21 seems to work without issues.

tobiasKaminsky commented 3 years ago

For our projects it still fails with 1.5.21 Ref: https://github.com/nextcloud/android-library/pull/669

trietbui85 commented 3 years ago

Should we still use vanniktech/gradle-android-junit-jacoco-plugin since the author doesn't seem to maintain it?

dsuresh-ap commented 3 years ago

You need JaCoCO 0.8.7 for Java 11 but compiling the source with Java 11 results in a error. See https://issuetracker.google.com/issues/178400721

The setup we went with is:

mariofelesdossantosjunior commented 3 years ago

I believe the problem is AGP 7.x.x in AGP 4.2.2 apparently everything is fine

The setup we went with is:

AGP 4.2.2 Kotlin 1.5.x+ JaCoCo 0.8.7 Java 11 set as the JDK Java 1.8 set as jvmTarget and compileOptions

Using AGP 7.0.2 is simply not generating jacoco in Android modules 2021-09-04_20-58

jakubdzubak1 commented 2 years ago

I faced same issue after updating AGP from 4.2.2 to 7.0.4, jacoco folder was missing in build dir.

My current setup: AGP 7.0.4 Kotlin 1.6.10 JaCoCo 0.8.7 Java 11 set as the JDK Java 1.8 set as jvmTarget and compileOptions

I had to change execution data path in jacoco.gradle using executionData.from = files("${project.buildDir}/outputs/unit_test_code_coverage/sandboxDebugUnitTest/testSandboxDebugUnitTest.exec")

Screenshot 2022-01-01 at 15 17 24