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
"Duplicate class io.mockk.ValueClassSupportKt found" when using in 1.12.0 #722
Comments
Could this be happening due to |
What worked for me was excluding the second module for the configurations {
androidTestImplementation {
exclude group: 'io.mockk', module: 'mockk-agent-jvm'
}
} |
@HarisHoulis yep, this workaround works for me too. |
Still having this issue on 1.12.3 |
Any idea how to apply this to all the modules at once? When I tried this in the top-level (root) allprojects {
configurations.findByName("androidTestImplementation")?.run {
logger.log(LogLevel.LIFECYCLE, "Excluding mockk-agent-jvm from: $projectName")
exclude(group = "io.mockk", module = "mockk-agent-jvm")
} ?: run {
logger.log(LogLevel.LIFECYCLE, "Skipping exclusion of mockk-agent-jvm from: $projectName")
}
} then it didn't work. It looks like at this stage the The suggested workaround worked for me only when I added it in the module-specific Do you really think this issue should be closed already? Is there no way for the EDIT (Mar 24 14:44 UTC): If anyone is interested, I figured out I can exclude allprojects {
afterEvaluate {
configurations.findByName("androidTestImplementation")?.run {
exclude(group = "io.mockk", module = "mockk-agent-jvm")
}
}
} or by extracting the common parts of the module's setup from the fun Project.removeMockkAgentJvmFromAndroidTests() {
configurations.findByName("androidTestImplementation")?.run {
exclude(group = "io.mockk", module = "mockk-agent-jvm")
}
}
fun Project.defaultAndroidLibrary() = android {
removeMockkAgentJvmFromAndroidTests()
}
// Then, in each module's build.gradle.kts:
defaultAndroidLibrary() |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behaviour
Android instrumented tests should run.
Current Behaviour
Android instrumented tests fail with
Duplicate class io.mockk.ValueClassSupportKt found
compilation error (see stack trace below).Failure Information (for bugs)
When upgrading from 1.11.0 to 1.12.0, tests no longer run. Seems to be affecting others that have commented on #653.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: