问题描述
Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
After adding the the following dependencies in app.gradle file -
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'
Console Logs -
Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (25.0.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
I got the same probleme,when I add the following code in my app's build.gradle
within android { }
,that's ok.configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'}
you can get reason in this page
Execution failed for task 'app:prepareDebugAndroidTestDependencies'
这篇关于错误:任务':app:prepareDebugAndroidTestDependencies'的执行失败。 >依赖错误。详情请参阅控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!