gpt4 book ai didi

android - 使用 android studio 3.0.1 创建新项目时出错

转载 作者:行者123 更新时间:2023-11-29 18:54:56 25 4
gpt4 key购买 nike

错误:任务 ':app:preDebugAndroidTestBuild' 执行失败。

Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

编辑:以下摘自评论

以下是我的依赖项:

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

最佳答案

基于documentation :

Both your app APK and its test APK share the same classpath. So, you can get a build error if both APKs depend on different versions of the same library.

所以解决办法是改变你的

com.android.support:appcompat-v7:26.1.0

com.android.support:appcompat-v7:27.1.1

关于android - 使用 android studio 3.0.1 创建新项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50086012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com