【发布时间】:2020-06-11 03:02:42
【问题描述】:
错误:任务 ':app:preDebugAndroidTestBuild' 执行失败。
与项目 ':app' 中的依赖项 'com.android.support:support-annotations' 冲突。应用程序 (26.1.0) 和测试应用程序 (27.1.1) 的已解决版本不同。详情请见https://d.android.com/r/tools/test-apk-dependency-conflicts.html。
编辑:以下取自 cmets
以下是我的依赖项:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
}
【问题讨论】:
-
你能用`build.gradle`更新你的问题吗?
-
依赖项 { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android .support.constraint:constraint-layout:1.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso -core:3.0.2' androidTestImplementation 'com.android.support:support-annotations:27.1.1' }
-
这些是我在应用内实现的应用级依赖。我添加了最后一个 gradle androidTestImplementation 'com.android.support:support-annotations:27.1.1' 但错误没有解决。
-
我已经回答了问题,您可以查看
标签: android