2016-05-03 10 views
5

मैं त्रुटि निम्न जब मैं अपने Gradle.script (मॉड्यूल) एंड्रॉयड स्टूडियोJUnit को हल करने में विफल: JUnit: 12

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 

बाद में मेरी पहली अनुप्रयोग चलाने के लिए है

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' 
} 

की कोशिश की हो रही है बाद मेरी 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 
} 

किसी मेरी मदद कर सकते इस गड़बड़ फिक्सिंग है?

उत्तर

6

नीचे उल्लेख मार्ग का अनुसरण करें: अपने आवेदन/परियोजना पर

राइट क्लिक करें ->

खुला मॉड्यूल सेटिंग->

जाओ करने के लिए "निर्भरता" टैब ->

आप

मिल जाएगा: जूनिट: जूनिट: 4.12 "->

इसे चुनें और राइट क्लिक करें और विकल्प निकालें का चयन करें -> ठीक

अब अपने आवेदन को बनाने का प्रयास करें।

+0

थैंक्स मैन ............ जो मुझे अंदर से मार रहा था .. –

+1

@NaseerAhmed gald आपकी मदद करने के लिए। –

0

अपने कोड में नीचे लाइन निकालें

testCompile 'JUnit: JUnit: 4.12'

तो यह संकलन।