Issue
I am working in espresso test and I needed this following dependency:
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
for recycler-view to complete the test, but when I add this dependency I got this error :
Caused by: org.gradle.api.GradleException: Cannot find a version of >'com.google.android.material:material' that satisfies the version >constraints: Dependency path 'myproject:app:unspecified' --> >'com.google.android.material:material:1.0.0-beta01' Constraint path 'myproject:app:unspecified' --> >'com.google.android.material:material:{strictly 1.0.0-beta01}' because >of the following reason: debugRuntimeClasspath uses version 1.0.0->beta01
I can understand that this error is because this following dependency:
implementation 'com.google.android.material:material:1.0.0-beta01'
and I can solve it by changing the material dependency to other version but the problem if I change the material dependency the design will missed up, I dont want to change it
I already tried to use lower version of the esspreso-contrib to solve it but still this error keeps appears
I really don't want to change the material dependency and I need the test, so please anyone know to solve it, appreciate that
thanks in advance
[edit] Sorry did not mention that the app is running fine without errors but only when I run the test this error appears
Solution
I'm afraid I've been unable to reproduce your error in a test project.
However my first thought would be a transative dependency issue as I suspect that espresso-contrib is pulling and sharing an outdated version of material (1.0.0).
This may be an issue which some of the android x testing util libraries share.
Try replacing:
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
With:
androidTestImplementation ('androidx.test.espresso:espresso-contrib:3.2.0') {
exclude group: 'com.google.android.material', module: 'material'
}
Answered By - Keith Kirk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.