首页 > 解决方案 > Conflict with dependency app的解决方法是什么:preDebugAndroidTestBuild

问题描述

错误:任务“: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

标签: androidannotations

解决方案


对于 appcompat-v7:26.1.0。测试应该是 test:runner:1.0.1 & espresso-core:3.0.1'

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:26.1.0'

        androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    }

推荐阅读