android jacoco coverage empty with gradle

前端 未结 8 2239
旧巷少年郎
旧巷少年郎 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:24

    There's a problem in the Android Gradle Plugin 0.14.0 that generates an empty coverage.ec file. It's known and was fixed in a branch but doesn't seem to have made it out to the public yet: https://code.google.com/p/android/issues/detail?id=78556

    On the other hand, a lovely workaround template project for Android Studio can be found here using Jacoco and RoboElectric: https://github.com/nenick/android-gradle-template

    So you can wait for Google to fix it or use someone else's build library repository, but Android Studio 1.0.0's gradle plugin is useless.

提交回复
热议问题