Java – error (23,17) unable to parse JUnit: JUnit: 4.12 @ Android studio V.2

Currently using Android studio v.2 0

(23,17) unable to solve JUnit: JUnit: 4.12

I have installed the Android support repository to support the repository

My gradle code is in picture Android Studio V.2. 0 medium

Solution

You should be in build Add it to gradle (because JUnit is extracted from the Maven repository):

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'

   ....

}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>