gradle-android-junit-jacoco-plugin icon indicating copy to clipboard operation
gradle-android-junit-jacoco-plugin copied to clipboard

Plugin fails when testCoverageEnabled = true

Open tobiasKaminsky opened this issue 3 years ago • 4 comments

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.

tobiasKaminsky avatar May 12 '21 07:05 tobiasKaminsky

Same problem!

volkansahin45 avatar Jun 09 '21 17:06 volkansahin45

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.

tobiasKaminsky avatar Jun 11 '21 07:06 tobiasKaminsky

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

volkansahin45 avatar Jun 11 '21 07:06 volkansahin45

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

williamblevins avatar Sep 22 '21 20:09 williamblevins