Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure allowed (includes) package names? #214

Open
johnjohndoe opened this issue Oct 28, 2022 · 1 comment
Open

How to configure allowed (includes) package names? #214

johnjohndoe opened this issue Oct 28, 2022 · 1 comment

Comments

@johnjohndoe
Copy link

johnjohndoe commented Oct 28, 2022

I am trying to use version 0.16.0 in my multi-module Android application project which has one Android application module, multiple Android library modules and multiple Java library modules.

When I execute the jacocoTestReportDevDebug task in Android Studio the following failure occurs:

> Task :app:testDevDebugUnitTest

MyTest > initializationError FAILED
    java.lang.IllegalStateException at ClassReloadingStrategy.java:503
        Caused by: java.lang.UnsupportedOperationException at InstrumentationImpl.java:-2
        Caused by: java.lang.UnsupportedOperationException at InstrumentationImpl.java:-2

The failure does not occur when I execute the task from the shell.

This could theoretically be fixed by defining only packages of my projects to be included as can be done with a jacoco configuration block:

tasks.withType(Test) {
    jacoco {
        includes = [
                "com.example.android.*" // Prevents IllegalStateException at ClassReloadingStrategy.java
        ]
    }
}

How can I configure such includes within the junitJacoco configuation block?

@renmiantaohua123
Copy link

hello, Hi, have you solved this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants