Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Failed to resolve junit in Android Studio

$
0
0

A error will be shown if a new android project is created.

Error:(23, 17) Failed to resolve: junit:junit:4.12
<a href=”disable.gradle.offline.mode”>Disable offline mode and Sync</a><br><a href=”openFile:C:/Users/yuanje/AndroidStudioProjects/MyApplication3/app/build.gradle”>Show in File</a><br><a href=”open.dependency.in.project.structure”>Show in Project Structure dialog</a>

By replacing testCompile ‘junit:junit:4.12’ with testCompile fileTree(dir: ‘libs’, include: [‘*.jar’]) and putting junit-4.12.jar and hamcrest-core-1.3.jar in the app/libs folder.

the files can be downloaded from

https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar

https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar

 

 



Viewing all articles
Browse latest Browse all 764

Trending Articles