2016-11-03 11 views
9

enter image description here त्रुटि: निष्पादन कार्य के लिए विफल रहा ': app: readyDebugAndroidTestDependencies'।त्रुटि: निष्पादन कार्य के लिए विफल रहा ': ऐप: readyDebugAndroidTestDependencies' तैयार करें। > निर्भरता त्रुटि। विवरण के लिए कंसोल देखें

androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:rules:0.5' 
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
// add this for intent mocking support 
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2' 
// add this for webview testing support 
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.2' 

कंसोल लॉग - -

Dependency Error. See console for details.

app.gradle फ़ाइल में निम्न निर्भरता को जोड़ने के बाद

जानकारी: Gradle कार्यों [: एप्लिकेशन: स्वच्छ,: एप्लिकेशन: generateDebugSources,: एप्लिकेशन : mockableAndroidJar,: ऐप: readyDebugUnitTestDependencies, app: generDebugAndroidTestSources,: app: assembleDebug] चेतावनी: निर्भरता के साथ संघर्ष 'com.android.support:support-annotations'। ऐप (25.0.0) और परीक्षण ऐप (23.1.1) के लिए हल संस्करण अलग-अलग हैं। विवरण के लिए http://g.co/androidstudio/app-test-app-conflict देखें। त्रुटि: निष्पादन कार्य के लिए विफल रहा ': ऐप: readyDebugAndroidTestDependencies' तैयार करें।

Dependency Error. See console for details. Information:BUILD FAILED Information:Total time: 28.459 secs Information:1 error Information:1 warning Information:See complete output in console

उत्तर

11

मैं एक ही probleme मिला, जब मैं android { } भीतर मेरे ऐप की build.gradle में निम्न कोड जोड़ने के लिए, कि ठीक है।

androidTestCompile 'com.android.support:support-annotations:25.0.0' 

पुस्तकालय के नवीनतम संस्करण का उपयोग कर के लिए मजबूर करने

तुम भी कोशिश कर सकते हैं: configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1' } तो आप इस पेज
Execution failed for task 'app:prepareDebugAndroidTestDependencies'

+1

धन्यवाद के तहत इसे जोड़ें! एक ही समस्या थी और यह हल हो गया – enyciaa

8

आप अपने निर्भरता को यह लाइन जोड़ने की जरूरत में कारण प्राप्त कर सकते हैं espresso-contrib लाइब्रेरी

dependencies { 
    ext.JUNIT_VERSION = '4.12' 
    ext.AA_VERSION = '4.0.0' 
    ext.SUPPORT_VERSION = '24.1.1' 
    ext.ESPRESSO_VERSION = '2.2.2' 

... 

    androidTestCompile "com.android.support:support-annotations:$SUPPORT_VERSION" 
    androidTestCompile "com.android.support.test.espresso:espresso-core:$ESPRESSO_VERSION" 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    androidTestCompile "com.android.support.test.espresso:espresso-intents:$ESPRESSO_VERSION" 
    /** 
    * AccessibilityChecks 
    * CountingIdlingResource 
    * DrawerActions 
    * DrawerMatchers 
    * PickerActions (Time and Date picker) 
    * RecyclerViewActions 
    */ 
    androidTestCompile("com.android.support.test.espresso:espresso-contrib:$ESPRESSO_VERSION") { 
     exclude group: 'com.android.support', module: 'appcompat' 
     exclude group: 'com.android.support', module: 'support-v4' 
     exclude group: 'com.android.support', module: 'support-v7' 
     exclude group: 'com.android.support', module: 'design' 
     exclude module: 'support-annotations' 
     exclude module: 'recyclerview-v7' 
    } 
के लिए किए गए संघर्ष पैकेजों को बाहर करने के लिए
1

यह डीबग ऐप और परीक्षण ऐप में लाइब्रेरी संस्करण संघर्ष के कारण होता है। एंड्रॉइड {} टैग

configurations.all { 
    resolutionStrategy { 
     force 'com.android.support:support-annotations:24.1.1' 
    } 
} 
संबंधित मुद्दे

 संबंधित मुद्दे