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

Plugin fails when testCoverageEnabled = true #194

Open tobiasKaminsky opened 3 years ago

tobiasKaminsky commented 3 years ago

I try to us this plugin instead of the old unsupported jacoco plugin. https://github.com/nextcloud/android-library/pull/612/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7L16

Here you can see how I changed it. But when running ./gradlew assemble or ./gradle tasks it fails with:

* What went wrong:
A problem occurred configuring root project 'android-library'.
> Could not create task ':testDebugUnitTest'.
   > java.lang.NullPointerException (no error message)

Stacktrace/info/debug does not help me.

volkansahin45 commented 3 years ago

Same problem!

tobiasKaminsky commented 3 years ago

In my case the problem was that the project structure is old. There is only one build.gradle and no sub folder for actual sourcecode (e.g. app). Once I adapted to new structure it works.

volkansahin45 commented 3 years ago

I had different modules with their own build gradle. Everthing seemed good until I set testcoveragenabled in one of the module build.gradle.

williamblevins commented 3 years ago

Ditto. Adding testCoverageEnabled true like in the README causing the task step to get skipped.