当前位置: 代码迷 >> 综合 >> 解决 执行jacocoTestReport生成报告时 报Unable to read execution data file coverage.ec
  详细解决方案

解决 执行jacocoTestReport生成报告时 报Unable to read execution data file coverage.ec

热度:65   发布时间:2023-12-19 13:41:48.0

1. 问题

1.1 运行  jacocoTestReport

gradle jacocoTestReport
$ gradle jacocoTestReport
报如下错
* What went wrong:
Execution failed for task ':app:jacocoTestReport'.
> Unable to read execution data file E:\app\build\outputs\code-coverage\connected\coverage.ec

2.解决

将build.gradle

jacoco {
    toolVersion = "0.7.9"
}

改为
jacoco {
    toolVersion = "0.7.4+"
}
再运行
  gradle jacocoTestReport  报告成功生成


  相关解决方案