解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错

解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错

 

在Android Studio 创建新项目的时候,出现这个报错:

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.

解决办法:在 build.gradle 添加

android {
    ...
}

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

dependencies {
    ...
}

希望可以帮助到大家。



作者:JairusTse
链接:https://www.jianshu.com/p/42fb70aa1602
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
posted @ 2018-07-17 17:50  飞雪飘鸿  阅读(361)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL