I was able to get the code coverage report by following the steps below,
Enable coverage on the build type you want (e.g. debug)
buildTypes {
I wrote an article about the same scenario and my solution. You can read it here. For answering this specific question you should do the following steps: Change gradle to this:
apply plugin: 'jacoco'
jacoco {
toolVersion = '0.7.5.201505241946'
}
Second download this jar. Continue with the things you did until you have coverage.ec file. Then when you have it run:
java -jar android-jacoco-the-missing.jar -f /path/to/coverage.ec -p ./path/to/android/project
And thats it! The jar will generate a folder with the code coverage.
Another option is to use the coverage.ec with the Jenkins Jacoco plugin. But for that you need to have Jenkins set on.