Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find a version of 'androidx.test:monitor' that satisfies the version constraints

I am getting this error while running a fragment test which is a simple test that launches fragmentInContatiner:

    Cannot find a version of 'androidx.test:monitor' that satisfies the version constraints: 
   Dependency path 'Host Work.features:ui-home:unspecified' --> 'androidx.test:runner:1.2.0' --> 'androidx.test:monitor:1.2.0'
   Constraint path 'Host Work.features:ui-home:unspecified' --> 'androidx.test:monitor:{strictly 1.1.1}' because of the following reason: debugRuntimeClasspath uses version 1.1.1
   Dependency path 'Host Work.features:ui-home:unspecified' --> 'androidx.fragment:fragment-testing:1.2.0-alpha02' --> 'androidx.test:core:1.1.0' --> 'androidx.test:monitor:1.1.1'

Here are my gradle dependencies that are creating this problem:

implementation 'androidx.fragment:fragment:1.2.0-alpha02'
debugImplementation 'androidx.fragment:fragment-testing:1.2.0-alpha02'
implementation 'androidx.test:core:1.2.0-alpha02'
implementation 'androidx.test:runner:1.2.0-alpha02'
like image 262
doersweb Avatar asked Dec 13 '22 10:12

doersweb


1 Answers

I found the problem and had to exclude the core module from fragment-testing dependency. It was this conflict that was creating the problem.

debugImplementation ("androidx.fragment:fragment-testing:1.2.5") {
    exclude group: "androidx.test", module : "core"
}
like image 85
doersweb Avatar answered Jan 13 '23 12:01

doersweb