Error while instrumenting classes with Jacoco plugin on Jenkins

After upgrading to Gradle version 5.5.1 my tests started failing on Jenkins with the following errors:

  1. Error while instrumenting class
  2. Class is already instrumented

My Jacoco Version is 0.8.4 and I also use PowerMock 1.6.5 version.
Here is my Jacoco configuration:

// Jacoco config
apply plugin: 'jacoco'

jacoco {
    toolVersion = project.ext.jacocoToolVersion
}

tasks.withType(Test) {
   jacoco.includeNoLocationClasses = true
}

 def coverageSourceDirs = [
       'src/main'
]

task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
  group = "Reporting"

description = "Generate Jacoco coverage reports"

classDirectories = fileTree(
        dir: 'build/intermediates/classes',
        excludes: ['**/R.class',
                   '**/R$*.class',
                   '**/*$ViewInjector*.*',
                   '**/BuildConfig.*',
                   '**/Manifest*.*']
)

additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
executionData = files('build/jacoco/testDebugUnitTest.exec')

reports {
    xml.enabled = true
    html.enabled = true
}

}