question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AndroidX.test dependency error

See original GitHub issue
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

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
slottcommented, Jun 18, 2019

Yeah - this is still happening…

6reactions
cheskoscommented, Jun 29, 2019

Found and easy an convenient solution:

implementation ("androidx.fragment:fragment-testing:1.1.0-beta01",         
   exclude group: 'androidx.test', module: 'core'
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

AndroidX.test dependency error · Issue #294 - GitHub
The following error occurs: Cannot find a version of 'androidx.test:monitor' that satisfies the version constraints: Dependency path ...
Read more >
Unable to resolve dependency androidx.test:core:1.9.0-alpha01
Try changing this: test_version = '1.9.0-alpha01'. To this: test_version = '1.4.1-alpha04'. (I think the version you declared doesn't exist: ...
Read more >
Set up project for AndroidX Test - Android Developers
In order to use AndroidX Test, you must modify your app project's dependencies within your development environment.
Read more >
Adding dependency androidx.appcompat ... - Issue Tracker
Adding dependency androidx.appcompat:appcompat:1.6.0-alpha03 to Jetpack Compose project results in duplicate class error.
Read more >
Easy Instrumented Tests (UI Tests) for Android in 2021
In the android.defaultConfig block add the testInstrumentationRunner for be able to “launch” our tests, in the case you use a custom application class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found