您应该在build.gradle中
添加它(因为junit是从maven存储库中
提取的):
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter { url "http://jcenter.bintray.com/" }
}
dependencies {
compile fileTree(include: ['*.jar'],dir: 'libs')
testCompile 'junit:junit:4.12'
....
}
原文链接:https://www.f2er.com/java/121882.html