use coverage plugin
MODIFY
analytics/build.gradle
analytics/build.gradle
apply plugin: 'com.android.library'
apply plugin: 'checkstyle'
apply plugin: 'com.f2prateek.checkstyle'
+apply plugin: 'com.vanniktech.android.junit.jacoco'
apply from: rootProject.file('gradle/android.gradle')

MODIFY
build.gradle
build.gradle
@@ -6,6 +6,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.f2prateek.checkstyle:checkstyle:1.0.1'
+ classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0'
}
}

use coverage plugin