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

Dependency problem #222

Open
hannesa2 opened this issue Oct 4, 2021 · 3 comments
Open

Dependency problem #222

hannesa2 opened this issue Oct 4, 2021 · 3 comments

Comments

@hannesa2
Copy link

hannesa2 commented Oct 4, 2021

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
image

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

any Ideas ?

@hannesa2
Copy link
Author

hannesa2 commented Oct 4, 2021

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 ?

@johanhaleby
Copy link
Collaborator

@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 :)

@ozmium
Copy link

ozmium commented Oct 13, 2023

The same problem is also reported here: #194

Thank you for your solution.

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

3 participants