Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve junit:junit:4.12

Add below repository in your build.gradle file,

repositories {
      jcenter()
      maven {
        url 'https://maven.google.com'
    }
}

you forgot to add this to your dependencies

androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0' 

The problem is caused by espresso library , if you can't remove it add this to your app gradle

android
{ 
 configurations.all 
  { 
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' 
  }
}

Tags:

Android

Gradle