You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Gradle 7.5.1 when I try to get a jacoco report, or a list of tasks, I get this error:
What went wrong
Execution failed for task ':app:tasks'.
> Could not create task ':app:jacocoTestReportDebug'.
> 'org.gradle.api.provider.Property org.gradle.api.reporting.ConfigurableReport.getOutputLocation()'
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:tasks'
...
Caused by: java.lang.NoSuchMethodError: 'org.gradle.api.provider.Property org.gradle.api.reporting.ConfigurableReport.getOutputLocation()'
at de.mannodermaus.gradle.plugins.junit5.internal.extensions.ConfigurableReportExtKt.getOutputLocationFile(ConfigurableReportExt.kt:7)
at de.mannodermaus.gradle.plugins.junit5.tasks.AndroidJUnit5JacocoReport$ConfigAction.execute(AndroidJUnit5JacocoReport.kt:101)
It works fine on Gradle 8.2.1.
Steps to Reproduce
Create an empty project on Gradle 7.5.1: root build.gradle.kts:
plugins {
id("com.android.application") version "7.4.2" apply false
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
id("de.mannodermaus.android-junit5") version "1.9.3.0" apply false
}
Hey, thanks for reporting. The Gradle folks changed the return type of Report.outputLocation in an unexpected manner between Gradle 7.5.1 and Gradle 8.x (link). It used to be a Provider<T> and now it's a Property<T>, which is what the codebase currently expects as well. It should be possible to resolve the hierarchy in a way that supports both the old and new type signature, but it's unfortunate that the current functional tests did not catch this. I'm going to surface the issue in tests first and then tackle this!
…e versions
There is a binary incompatibility between Gradle 7 and 8 that changed the return type
of `outputLocation`. Catch an error with the new method and fall back to a safe alternative
(see #302)
…location of Jacoco reports (#304)
* Add test project to expose NoSuchMethodError with Jacoco on AGP 7.4 and Gradle 7.5
* Use fallback to access Jacoco report output location from older Gradle versions
There is a binary incompatibility between Gradle 7 and 8 that changed the return type
of `outputLocation`. Catch an error with the new method and fall back to a safe alternative
(see #302)
On Gradle 7.5.1 when I try to get a jacoco report, or a list of tasks, I get this error:
It works fine on Gradle 8.2.1.
Steps to Reproduce
Create an empty project on Gradle 7.5.1:
root build.gradle.kts:
app build.gradle.kts:
Run
Environment
The text was updated successfully, but these errors were encountered: