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

穿精又带淫゛_ 提交于 2019-11-26 23:06:29

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' 
  }
}

I was trying to mix AppCompat and Jetpack dependencies, and you cannot do that.

I think I might not have the right repository setup for the Jetpack libraries (why it can't find any Jetpack libraries).

Don't use: implementation 'androidx.appcompat:appcompat:1.0.2' . (this is Jetpack) -- use AppCompat versions of this (besides - Jetpack is NOT consistent with Appcompat versions earlier then 28.x). Bottom line, get rid of anything that says (androidx).

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!