Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android中的Jacoco代码覆盖率为0%(使用Java8)_Java_Android_Gradle_Code Coverage_Jacoco - Fatal编程技术网

Android中的Jacoco代码覆盖率为0%(使用Java8)

Android中的Jacoco代码覆盖率为0%(使用Java8),java,android,gradle,code-coverage,jacoco,Java,Android,Gradle,Code Coverage,Jacoco,我在计算Android、gradle 2.14.1和Java8上的代码覆盖率时遇到问题 我已将testCoverageEnabled添加到我的应用程序build.gradle中: apply plugin: 'jacoco' android { debug { testCoverageEnabled true } } 我可以使用/gradlew createDebugCoverageReport执行Jacoco 我得到了覆盖率报告(html和.exec),但覆

我在计算Android、gradle 2.14.1和Java8上的代码覆盖率时遇到问题

我已将testCoverageEnabled添加到我的应用程序build.gradle中:

apply plugin: 'jacoco'

android {
    debug {
        testCoverageEnabled true
    }
}
我可以使用/gradlew createDebugCoverageReport执行Jacoco


我得到了覆盖率报告(html和.exec),但覆盖率始终为0%。有人遇到过这个问题并解决了吗?

我面临着同样的问题,我也提出了同样的问题。在我的案例中,这是设备特定的问题。我在三星Tab4上运行它,覆盖率显示为0%。当我在Emulator和其他设备(Asus Zenpad)上运行相同的程序时,它会显示正确的覆盖率报告。嗯,我想为单元测试计算它。你试过这个吗?单元测试对我来说也很有效