"jacocoTestReportDebug" task name conflict with android-junit5 plugin
WhosNickDoglio opened this issue · 6 comments
Gradle: 5.2.1
Android Gradle Plugin: 3.3.2
Error: "Cannot add task 'jacocoTestReportDebug' as a task with that name already exists."
Tried adding the android-junit5 plugin to a project already using this plugin and got the above error message.
Hmmm weird. So what's the conclusion?
I've asked in the gradle slack channel and there advised two solutions:
- Use another task name
- Use
maybe create
. Example:
https://github.com/mannodermaus/android-junit5/blob/fc4a12527d818d1d5c9e70f250cdfd05cf3efb8b/android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/tasks/Jacoco.kt#L96
We could be using maybeCreate
.
How do the task inputs differ though? I'm curious since it's not really clear which plugin gets to add the task first
I'm closing this issue due to inactivity. If you have any further input on the issue, don't hesitate to reopen this issue or post a new one.
This issue also pops up if you include another project (in my case antoher Android library project), and both projects use the gradle-android-junit-jacoco-plugin
. Apparantly both projects then try to add the task jacocoTestReportDebug
. This does not happen with all other tasks, e.g. lintDebug
or assemble
though.