提示错误信息如下:

Error:A problem occurred configuring project ':app'.
> Could not download junit.jar (junit:junit:4.12)
   > Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'.
      > Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'.
         > Connection to https://jcenter.bintray.com refused

原因是在APP 的build.gradle中的

dependencies {    ......    testCompile 'junit:junit:4.12'   ......... }编译测试用例时编译了'junit:junit:4.12;把该行去掉;编译出现错误如下:
D:\android_work\MyApplication\app\src\test\java\com\example\gchen\myapplication\ExampleUnitTest.java
Error:(3, 17) error: package org.junit does not exist
Error:(5, 24) error: package org.junit does not exist
Error:(11, 6) error: cannot find symbol class Test
Error:(13, 9) error: cannot find symbol method assertEquals(int,int)

原因是没有找到org.junit这个包,这个包的位置在android studio 目录下的

gradle\gradle-2.10\lib\plugins\junit-4.12.jar;把这个包复制到项目APP的libs目录下即可;

更多相关文章

  1. android EditText设置不可写
  2. android ndk编译x264开源(用于android的ffmpeg中进行软编码)
  3. Android(安卓)Activity的启动
  4. [android]编译时出现/usr/bin/ld: skipping incompatible /usr/l
  5. 编译android的linux内核
  6. Android(安卓)命令行编译、打包生成apk文件
  7. APP开发实战94-Vector静态图的使用
  8. Android热更新框架Tinker无法更新?
  9. Android(安卓)开发中的倒计时

随机推荐

  1. eof在c语言中表示什么
  2. c语言本身没有输入输出语句吗
  3. c语言中continue语句的作用是什么
  4. C语言中字符串的结束标志是什么
  5. vc++和c++之间有什么区别?
  6. C语言标识符有哪三类
  7. strcat函数的作用是什么
  8. c语言是高级语言吗?
  9. strcpy函数的作用是什么
  10. c++引用和指针的区别是什么?