Android gradle报错

具体问题:Error : Execution failed for task ’ :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.


解决方案:在appbuild.gradle中的Android{...}添加如下代码:

configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}

 

posted @ 2019-09-17 13:17  ~Monologue  阅读(230)  评论(0编辑  收藏  举报