下载了Android Studio 3.1.4,新建一个项目,选择Activity,结果gradle提示

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
Open File
Show Details

 

 

解决方法

1、下载junit

点击 https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar,放在...\Android Studio\gradle\gradle-4.4\lib\plugins中,并重启Android Studio。

不过这个plugins都会有junit包的。

 

2、注释bulid.gradle中的junit行,看图,顺便注释一下 androidTestImplementation。

Android Studio: Could not download junit.jar (junit:junit:4.12)

 

相关文章:

  • 2021-05-28
  • 2021-10-15
  • 2022-12-23
  • 2021-11-21
  • 2021-09-08
  • 2022-01-05
  • 2021-05-23
猜你喜欢
  • 2021-05-19
  • 2021-06-17
  • 2021-06-22
  • 2021-09-16
  • 2021-07-05
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案