无法接收配置的所有依赖项':app:_debugUnitTestApkCopy'

时间:2016-11-11 15:14:07

标签: android android-studio

当我尝试在android studio中运行应用程序时出现以下错误。

错误:配置项目':app'时出现问题。

  

无法解析配置':app:_debugUnitTestApkCopy'的所有依赖项。   无法解决junit:junit:4.12。        要求:            MyFirstAppp:应用程序:未指定   无法解决junit:junit:4.12。   无法获取资源“https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom”。   无法获得“https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom”。   连接到jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188]失败:连接超时:连接

2 个答案:

答案 0 :(得分:0)

您是否有代理限制或连接问题,不允许gradle连接和编译JUnity。

你可以删除这行来自build.gradle(module:app)的依赖

testCompile 'junit:junit:4.12'

答案 1 :(得分:0)

感谢Ramos的回复。我有另一个解决这个错误的方法。以下是解决错误的步骤。

      1. download junit-4.12.jar from https://mvnrepository.com/artifact/junit/junit/4.12
      2. Then put junit-4.12.jar into your <project>/app/libs/ directory
      3. Right click on your project and then select "Open Module Settings". Then go to tab "Dependencies"
      4. From "Dependencies" tab, select and delete junit-4.12.jar
      5. Then add junit-4.12.jar from your <project>/app/libs directory
      6. Then rerun your project.

由于