Gradle Jacoco Plugin - Unable to load class 'org.jacoco.core.analysis.ICoverageVisitor'.

53 views
Skip to first unread message

vic zhang

unread,
Sep 27, 2020, 10:42:19 PM9/27/20
to JaCoCo and EclEmma Users
Hi all,

I try to use Jacoco plugin of Gradle 6.5 to generate code coverage report, my build.gradle looks like as:
plugins {
    id "org.sonarqube" version "3.0"
    id 'jacoco'
}
jacocoTestReport {
    reports {
        xml.enabled true
        html.enabled true
        csv.enabled false
        html.destination file("${buildDir}/jacoco")
    }
}

test.finalizedBy jacocoTestReport

But when I try to run test or jacocoTestReport task, I get following error:
Unable to load class 'org.jacoco.core.analysis.ICoverageVisitor'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Does anybody know what's wrong? thanks a lot.

BR,
Vic

vic zhang

unread,
Sep 27, 2020, 10:46:57 PM9/27/20
to JaCoCo and EclEmma Users
BTW, my Java project bases on AdoptOpenJDK 11, when I clicks on "Re-download dependencies and sync project (requires network) " link, I get below dialog which requires me to select both Android and Java JDK(otherwise, the OK button is disabled):

Marc Hoffmann

unread,
Sep 28, 2020, 3:47:01 AM9/28/20
to jac...@googlegroups.com
Hi,

neither gradle plugins not Sonarquibe are maintained by the JaCoCo project. Please see our integration matrix for pointers:


Regards,
-marc


-- 
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/c899969d-68ee-47f8-a07f-2935c853d2d4n%40googlegroups.com.

vic zhang

unread,
Sep 28, 2020, 9:35:29 PM9/28/20
to JaCoCo and EclEmma Users
Hi Marc,

Thanks for your reply. But, Gradle donwloads Jacoco plugin which records unit tests, it seems just throw this exception at last stage(generate coverage report).

Marc Hoffmann

unread,
Sep 29, 2020, 12:18:47 AM9/29/20
to jac...@googlegroups.com
Hi,

can you show the complete stack trace?

But as said before, the Gradle project is the better place to ask.

Regards,
-marc


Reply all
Reply to author
Forward
0 new messages