Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Thursday, December 24, 2015

Error:(23, 17) Failed to resolve: junit:junit:4.12

Error:(23, 17) Failed to resolve: junit:junit:4.12


im using Android Studio why every time I create a new project always comes up Error:(23, 17) Failed to resolve: junit:junit:4.12?

when I remove testCompile 'junit:junit:4.12' applications in dependencies no problem anymore...

build.gradle

apply plugin: 'com.android.application'    android {      compileSdkVersion 23      buildToolsVersion "23.0.1"        defaultConfig {          applicationId "com.okedroid.myapplication"          minSdkVersion 17          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.0.1'  }  

Answer by mdew for Error:(23, 17) Failed to resolve: junit:junit:4.12


I had the same problem. Solved by adding url for missing repository:

android {      [...]      repositories {          maven { url 'http://repo1.maven.org/maven2' }      }      [...]  }  

That's it.

Answer by Naveed Jamali for Error:(23, 17) Failed to resolve: junit:junit:4.12


Just remove the "testCompile 'junit:junit:4.12'" from build.gradle file:

dependencies {  compile fileTree(dir: 'libs', include: ['*.jar'])  testCompile 'junit:junit:4.12'//remove this line and sync again... worked for me  compile 'com.android.support:appcompat-v7:23.0.1'   }  

worked for me and I am Happy! :)

Answer by Muhammad Salman for Error:(23, 17) Failed to resolve: junit:junit:4.12


Remove the line testCompile 'junit:junit:4.12'

dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    compile 'com.android.support:appcompat-v7:23.0.1'   }  

After that sync the project again.

Answer by Gaurav Polekar for Error:(23, 17) Failed to resolve: junit:junit:4.12


add repository in youe build.gradle file

repositories {      maven { url 'http://repo1.maven.org/maven2' }  }  

Answer by Al Lelopath for Error:(23, 17) Failed to resolve: junit:junit:4.12


I received this error after creating a new project. In the build.gradle file, I had this:

jcenter()  

I change it to the following and the error went away:

jcenter {      url "http://jcenter.bintray.com/"  }  

I think this is because I am behind a firewall and specifying the url like so changes it from https to http

Answer by Asem Daaboul for Error:(23, 17) Failed to resolve: junit:junit:4.12


Probably you are behind proxy. Happened to me, used my mobile tethering (no proxy) rebuild project and error disappeared. Returned to original connection (with proxy) and rebuild with no errors.

Answer by Mona for Error:(23, 17) Failed to resolve: junit:junit:4.12


Its not able to get junit library..

repositories { maven { url 'http://repo1.maven.org/maven2' } }

After adding above line inside android block in build.gradle file it resolved. This can be because your Android studio doesn't have junit library.

Answer by Oliver Muthomi for Error:(23, 17) Failed to resolve: junit:junit:4.12


Simply try to compile and run you project while having active internet connection.

it worked for me in Android studio 1.5 Ubuntu 15.04

Answer by hasan sabbir for Error:(23, 17) Failed to resolve: junit:junit:4.12


dependencies {      compile fileTree(dir: 'libs', include: ['*.jar'])         compile 'com.android.support:appcompat-v7:23.1.1'  }  

Note: Remove testCompile 'junit:junit:4.12' line has been solved my problem.

Answer by mahdi pishguy for Error:(23, 17) Failed to resolve: junit:junit:4.12


CHANGE your build.gradle like with this, work fine for me:

apply plugin: 'com.android.application'    android {      compileSdkVersion 23      buildToolsVersion "22.0.1"      repositories {          maven { url 'http://repo1.maven.org/maven2' }      }      defaultConfig {          applicationId "YOUR PACKAGE NAME"          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.0.0'  }  

added

    repositories {          maven { url 'http://repo1.maven.org/maven2' }      }  

to android


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.