Sonarqube code coverage is showing 0.0% after using Jacoco plugin

I am using both Java and kotlin code. But after using Jacoco plugin still my code coverage is showing 0.0%. I am able to generate the test coverage report but In my sonar dashboard code coverage is showing 0.0%.

version Details.
org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8
kotlin_version = ‘1.3.61’
clover ‘org.openclover:clover:4.2.0’
jacoco=‘0.8.2’

Gradel Properties:

systemProp.sonar.dynamic=reuseReports
sonar.sourceEncoding=UTF-8
systemProp.sonar.sourceEncoding=UTF-8
sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
sonar.jacoco.reportPaths=build/reports/jacoco/jacoco.xml
sonar.clover.reportPath=build/reports/clover.xml
sonar.junit.reportPaths=build/reports/jacoco/
sonar.java.binaries=target/classes,app/build/tmp/kotlin-classes

Build.gradel

apply plugin: ‘org.sonarqube’
apply plugin: ‘jacoco’
apply plugin: ‘java’

buildscript {
ext.kotlin_version = ‘1.3.61’
repositories {
mavenLocal()

    maven { url "$nexusUrl/content/groups/public/" }
    maven { url "$nexusUrl/content/groups/google/" }
    google()
    maven { url "https://maven.fabric.io/public" }
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath 'com.google.gms:google-services:4.3.3'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.firebase:perf-plugin:1.3.1'
    classpath "io.fabric.tools:gradle:1.31.2"
    classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
    classpath "com.bmuschko:gradle-clover-plugin:2.2.0"
    }
}

if (Boolean.valueOf(enable_clover)) {
    apply plugin: 'com.bmuschko.clover'
    project.tasks["sonarqube"].dependsOn cloverAggregateReports
}

allprojects {

    if (Boolean.valueOf(enable_clover)) {
        apply plugin: 'com.bmuschko.clover'

        dependencies {
            clover 'org.openclover:clover:4.2.0'
        }

        clover {
            instrumentLambda = "block"
            report {
                html = false
                xml = true
            }
        }
    }
    sonarqube {
        properties {
            property "sonar.dynamicAnalysis", "reuseReports"
            property "sonar.clover.reportPath", "build/reports/clover/clover.xml"
            property "sonar.coverage.exclusions", "src/main/res/**"
            property "sonar.jacoco.reportPaths", "build/reports/jacoco/jacoco.xml"
        }
    }
    if (!Boolean.valueOf(enable_clover)) {
        apply plugin: "jacoco"
        jacoco {
            toolVersion = "0.8.2"
            reportsDir = file("$buildDir/reports/jacoco")
        }

        jacocoTestReport {
            group = "Reporting"
            description = "Generate Jacoco coverage reports after running tests."
            reports {
                xml.enabled true
                html.enabled true
                csv.enabled false
            }
            additionalSourceDirs = files("src/main/java")
            finalizedBy jacocoTestCoverageVerification
        }

        jacocoTestCoverageVerification {
            violationRules {
                rule {
                    limit {
                        minimum = min_local_coverage.toBigDecimal()
                    }
                }
            }
        }
        test {
            finalizedBy jacocoTestReport
        }
    }

    repositories {
        mavenLocal()

        maven { url "$nexusUrl/content/groups/public/" }
        maven { url "$nexusUrl/content/groups/google/" }

        maven {
            url 'http://maven.apptimize.com/artifactory/repo'
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
        maven {
            url "http://kochava.bintray.com/maven"
        }
        maven {
            url 'http://repo.brightcove.com/releases'
        }
        google()
    }

}

After all executing ./gradlew sonarqube task. Output Build is successful but code coverage is showing 0.0%.

Hi,

Welcome to the community!

It would be useful to also see your analysis logs, particularly the portion related to reading the report.

 
Ann