0

i am using studio 2.0 every time in new project it shows error(26,17) failed to resolve junit:junit:4.12. after reading on stackover flow i added repository in build.gradle but it still not work for me.

here is code:

(project:myapplication)

// Top-level build file where you can add configuration options common to   all sub-projects/modules.

buildscript {
repositories {
    jcenter()
    //jcenter{url 'http://jcenter.bintray.com/'}
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}}
repositories{
maven{url 'http://repo1.maven.org/maven2'}
jcenter { url 'http://jcenter.bintray.com/' }}
allprojects {
repositories {
    jcenter()
   // jcenter{url 'http://jcenter.bintray.com/'}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


(module:app)

apply plugin: 'com.android.application'
repositories{
maven{url 'http://repo1.maven.org/maven2'}
jcenter { url 'http://jcenter.bintray.com/' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.example.akshay.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.2.1'
compile 'com.android.support:design:23.1.1'
}

0 Answers0