3

When I try to add dependency on AndroidX Test JUnit 1.0.0-beta01: androidTestImplementation androidx.test.ext:junit:1.0.0-beta01, Gradle Sync fails with the following error:

Failed to resolve: org.junit:junit:4.12

All manipulations with adding org.junit dependency manually didn't help either.

3
  • Use testImplementation 'junit:junit:4.12'. Commented Oct 9, 2018 at 10:37
  • @RakeshKumar This dependency is present, it doesn't change anything. Commented Oct 9, 2018 at 10:39
  • I am running into the same issue. We are trying to replace the deprecated AndroidJUnit4 with the ext version, but are seeing this org.junit:junit:4.12 issue. Commented Oct 9, 2018 at 14:31

2 Answers 2

3

The above issue has been fixed in 1.0.0-beta02

'androidTestImplementation "androidx.test.ext:junit:1.0.0-beta02'

Sign up to request clarification or add additional context in comments.

Comments

2

you can exclude 'org.junit' group manually.

androidTestImplementation("androidx.test.ext:junit:1.0.0-beta01") { exclude group: "org.junit" } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.