正确决解 Failed to resolve: junit:junit:4.12

来源:互联网 发布:淘宝软文代写怎么赚钱 编辑:程序博客网 时间:2024/05/17 23:51

我的环境如下:android studio 2.3

第一次启动工程,studio 会编译junit 这个包

网上有很多解决方法,有的人是在build.gradle 中这样改动:

repositories {    maven { url 'http://repo1.maven.org/maven2' }    jcenter { url "http://jcenter.bintray.com/" }}
或者注释掉:

testCompile 'junit:junit:4.12'
正确的决解是将

 testCompile ---> androidTestCompile


如图:


阅读全文
0 0
原创粉丝点击