awaitility
awaitility copied to clipboard
Dependency problem
When I use
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test.ext:truth:1.4.0"
androidTestImplementation 'org.awaitility:awaitility:4.1.0'
I run into
Duplicate class org.hamcrest.CustomTypeSafeMatcher found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.Description found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.Description$NullDescription found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.DiagnosingMatcher found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.FeatureMatcher found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.Matcher found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.MatcherAssert found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
Duplicate class org.hamcrest.Matchers found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-library-1.3 (org.hamcrest:hamcrest-library:1.3)
Duplicate class org.hamcrest.SelfDescribing found in modules jetified-hamcrest-2.1 (org.hamcrest:hamcrest:2.1) and jetified-hamcrest-core-1.3 (org.hamcrest:hamcrest-core:1.3)
and much more ...
It's because you use org.hamcrest:hamcrest:2.1

and recent Android libs comes with org.hamcrest:hamcrest-core:1.3

any Ideas ?
Ok, I solved it with
androidTestImplementation('org.awaitility:awaitility:4.1.0') {
transitive = false
}
But I'm confused about this different versions. Is there any chance to change this ins your library ?
@hannesa2 Don't know much about espresso-core, but what I do know is that hamcrest 1.x is really old. I would say that they should probably upgrade :)
The same problem is also reported here: https://github.com/awaitility/awaitility/issues/194
Thank you for your solution.