Conflict with dependency 'com.android.support:support-annotations' in project '

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_38703938/article/details/81451092

事故图

解决方案

1.在gradle添加

androidTestCompile 'com.android.support:support-annotations:26.1.0'

我挂掉了,可能是AS3.0后的依赖出错,换下试试

androidTestImplementation 'com.android.support:support-annotations:26.1.0'

bingo!!!

2.也是在gradle添加

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

能解决问题的。

二者的比较

第一种是将依赖冲突改成一致,第二种是强制用26.1.0的配置

问题原因

依赖包和测试包冲突了

猜你喜欢

转载自blog.csdn.net/weixin_38703938/article/details/81451092