Failed to resolve Junit: Junit: 12

I get the following error when I tried to launch my first application in Android studio.

Error:A problem occurred configuring project ':app'. > Could not resolve all dependencies for configuration ':app:_debugUnitTestCompile'. > Could not resolve junit:junit:4.12. Required by: Hellow_World:app:unspecified > Could not resolve junit:junit:4.12. > Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'. > Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'. > jcenter.bintray.com 

Below is my Gradle.script (Module)

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.example.administrator.hellow_world" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' } 

Below is my Gradle.script (Hellow_World)

 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

Can someone help me fix this mess?

+5
source share
2 answers

Follow the path below:

Right click on your application / project β†’

open module settings β†’

Go to the "Dependencies" tab β†’

you will find "junit: junit: 4.12" β†’

select it and right-click and select the delete option β†’ ok

Now try to create an application.

+7
source

Remove the bottom line in the code

testCompile 'junit: junit: 4.12'

then compile it.

0
source

All Articles