依赖一个第三方包时,报了个错:
'com.android.support:recyclerview-v7'
has different version for the compile (27.0.2) and runtime (28.0.0) classpath.
You should manually set the same version via DependencyResolution
在原本的项目中已经依赖了28.0.0版本的v7包
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
依赖的第三方包中也依赖了v7包,但却是27.0.2版本,于是存在版本冲突
解决方法:
依赖第三方包时,剔除其中的v7包
implementation ('xxx') {
exclude group: 'com.android.support'
}
一般的依赖格式是:
implementation ‘com.android.support:appcompat-v7:28.0.0’
在剔除时,需要在 ’ ’ 外部添加() ,不然也会报错~~~