【发布时间】:2016-10-17 08:05:41
【问题描述】:
我收到消息:任务“app:prepareDebugAndroidTestDependencies”执行失败,我找不到它的内容。
我也试过这个答案https://stackoverflow.com/a/40019612/3925663的解决方案
错误日志:
警告:与依赖项“com.android.support:support-annotations”冲突。应用程序 (24.2.1) 和测试应用程序 (23.1.1) 的已解决版本不同。详情请见http://g.co/androidstudio/app-test-app-conflict。
错误:任务执行失败 ':app:prepareDebugAndroidTestDependencies'。 依赖错误。详情见控制台。
build.gradle:
apply plugin: 'com.android.application'
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.appspot.whatshouldiwearapp.wsiw"
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile 'com.android.support.test:runner:0.5'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
testCompile 'junit:junit:4.12'
}
解决问题的方法是什么?是什么原因造成的?
【问题讨论】:
标签: android build.gradle