Failed to resolve: junit:junit:4.12

Android Studio创建项目之后,提示一个junit错误.
错误提示图

解决方案: 
第一步:找到build.gradle的file,如图: 
点击路径,进入文件

第二步:
这里写图片描述

第三步:把中间行代码“testCompile ‘junit:junit:4.12’”删除掉
这里写图片描述

第四步:点击”Try Again”,就可以正常使用了
这里写图片描述

原文地址:https://www.cnblogs.com/newcaoguo/p/6028123.html