testing-samples: AndroidX.test dependency error

androidTestImplementation 'androidx.test.ext:junit:1.1.1-alpha02'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha02'
androidTestImplementation 'androidx.test:rules:1.1.2-alpha02'

After adding the above dependency, the Espresso test run fails by giving below error. I am not using any other annotations other than @rule and @test, @RunWith. If I remove above dependency “androidx.test.ext:junit:1.1.1-alpha02” and drowngrade the runner and rules dependency to older version 1.1.0-alpha4 then it won’t throw the below error.

Cannot find a version of ‘androidx.annotation:annotation’ that satisfies the version constraints: Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test🏃1.1.2-alpha02’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test.ext:junit:1.1.1-alpha02’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test🏃1.1.2-alpha02’ --> ‘androidx.test:monitor:1.1.2-alpha02’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test.espresso:espresso-core:3.1.0-alpha4’ --> ‘androidx.test🏃1.1.2-alpha02’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test.ext:junit:1.1.1-alpha02’ --> ‘androidx.test:core:1.1.1-alpha02’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.core:core:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.collection:collection:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.cursoradapter:cursoradapter:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-utils:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.vectordrawable:vectordrawable:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.test.ext:junit:1.1.1-alpha02’ --> ‘androidx.test:core:1.1.1-alpha02’ --> ‘androidx.lifecycle:lifecycle-common:2.0.0’ --> ‘androidx.annotation:annotation:1.0.0’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.core:core:1.0.0-beta01’ --> ‘androidx.versionedparcelable:versionedparcelable:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-utils:1.0.0-beta01’ --> ‘androidx.documentfile:documentfile:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-utils:1.0.0-beta01’ --> ‘androidx.loader:loader:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-utils:1.0.0-beta01’ --> ‘androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-utils:1.0.0-beta01’ --> ‘androidx.print:print:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.customview:customview:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.viewpager:viewpager:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.coordinatorlayout:coordinatorlayout:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.drawerlayout:drawerlayout:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.slidingpanelayout:slidingpanelayout:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.interpolator:interpolator:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.swiperefreshlayout:swiperefreshlayout:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Dependency path ‘Espresso1:app:unspecified’ --> ‘androidx.appcompat:appcompat:1.0.0-beta01’ --> ‘androidx.fragment:fragment:1.0.0-beta01’ --> ‘androidx.legacy:legacy-support-core-ui:1.0.0-beta01’ --> ‘androidx.asynclayoutinflater:asynclayoutinflater:1.0.0-beta01’ --> ‘androidx.annotation:annotation:1.0.0-beta01’ Constraint path ‘Espresso1:app:unspecified’ --> ‘androidx.annotation:annotation’ strictly ‘1.0.0-beta01’ because of the following reason: debugRuntimeClasspath uses version 1.0.0-beta01 Constraint path ‘Espresso1:app:unspecified’ --> ‘androidx.annotation:annotation’ strictly ‘1.0.0-beta01’ because of the following reason: debugRuntimeClasspath uses version 1.0.0-beta01 Constraint path ‘Espresso1:app:unspecified’ --> ‘androidx.annotation:annotation’ strictly ‘1.0.0-beta01’ because of the following reason: debugRuntimeClasspath uses version 1.0.0-beta01 Constraint path ‘Espresso1:app:unspecified’ --> ‘androidx.annotation:annotation’ strictly ‘1.0.0-beta01’ be

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

Yeah - this is still happening…

Found and easy an convenient solution:

implementation ("androidx.fragment:fragment-testing:1.1.0-beta01",         
   exclude group: 'androidx.test', module: 'core'
})