android jacoco coverage empty with gradle

前端 未结 8 2289
旧巷少年郎
旧巷少年郎 2021-01-12 23:39

I\'m trying to make jacoco create a code coverage report for my android test project. I have the following in build.gradle:

apply plugin: \'com.android.appli         


        
8条回答
  •  忘掉有多难
    2021-01-13 00:11

    I found a solution to same problem from Jacoco code coverage in Android Studio with flavors. It has example what to do in case coverage.ec is generated instead of testDebug.exec.

    1. I created the jacocoTestReport task.

    2. I executed $./gradlew createDebugCoverageReport which generates the coverage.ec file

    3. After that I executed $./gradlew jacocoTestReport and that creates the HTML.

提交回复
热议问题