无法为类型为org.gradle.testing.jacoco.tasks.JacocoReport的任务'...'设置只读属性'classDirectories'的值

无法为类型为org.gradle.testing.jacoco.tasks.JacocoReport的任务'...'设置只读属性'classDirectories'的值

问题描述:

我刚刚使用新版本的Gradle将Android Studio更新到4.0,现在我的构建出现错误.

I just updated my Android Studio to 4.0 with a new version of Gradle, and I now have an error on my build.

无法为类型为org.gradle.testing.jacoco.tasks.JacocoReport的任务':app:testNameOfMyFlavorDebugUnitTestCoverage'设置只读属性'classDirectories'的值.

到目前为止,它一直运行良好,我不知道要进行哪些更改才能使其再次正常工作.

It's been working fine so far, I don't know what to change to make it work again.

在此处找到响应:在这里:使用Gradle过滤JaCoCo覆盖率报告

例如, classDirectories 替换为 classDirectories.from