Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Duplicate class org.junit.platform.commons.annotation.Testable found in modules junit-platform-commons-1.4.0.jar (org.junit.platform:junit-platform-commons:1.4.0) and kotlintest-core-3.3.0.jar (io.kotlintest:kotlintest-core:3.3.0) #927
Hi I'm new in Android and I'm trying to run some test.
But when I try to use kotlintest I get the following error:
This is my dependencies in gradle:
This seems to be a problem in which 2 libraries are loading the same dependency.
If you comment out espresso, does it work again? If it does, you'll have to exclude JUnit from one of the dependencies through an
Removing Espresso didn't work. But I think I found where the dependency is. This is part of what I get when I run the dependency tree in gradle:
I tried to exclude it with:
But it seems doesn't work. I'm doing something wrong with
Sorry when you mean
I assume when you mean restart. you mean restart Android Studio. isn't it?
What you mean with delete project's gradle, you mean removing the
Sorry, I don't have a wide experience with gradle.
I meant invalidate and restar, and action from android studio.
The project's gradle: there is a folder with all dependencies called
There's also the
You can also try reimporting the project, if it's in a
I'm now getting to the bottom of this issue.
It seems that we're actually defining that class inside KotlinTest, and that is causing these compatibility issues with Espresso, because it brings JUnit platform dependencies to the classpath.
I'll mark this as a bug and investigate further