Error:(23, 17) Failed to resolve: junit:junit:4.12

I had the same problem. Solved by adding url for missing repository in the build.gradle file:

android {
    [...]
    repositories {
        maven { url 'https://repo1.maven.org/maven2' }
    }
    [...]
}

That’s it.

Leave a Comment