Android Picasso提供混合版本错误

时间:2018-10-14 17:39:21

标签: android picasso

由于混合版本,我遇到了错误

  

所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。   找到版本28.0.0-rc01,27.1.0。示例包括'com.android.support:animated-vector-drawable:28.0.0-rc01'和'com.android.support:exifinterface:27.1.0'

com.android.support:exifinterface:27.1.0正在毕加索的统治下, 也许与毕加索有关,因为我添加了版本28,但毕加索仍在使用版本27,而Volley在使用版本28:

+--- com.android.volley:volley:1.1.+ -> 1.1.1
+--- com.android.support:exifinterface:28.0.0
|    \--- com.android.support:support-annotations:28.0.0
+--- com.android.support:support-annotations:28.0.0
\--- com.squareup.picasso:picasso:2.71828
 +--- com.squareup.okhttp3:okhttp:3.10.0
 |    \--- com.squareup.okio:okio:1.14.0
 +--- com.android.support:support-annotations:27.1.0 -> 28.0.0
 \--- com.android.support:exifinterface:27.1.0 -> 28.0.0 (*)


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.volley:volley:1.1.+'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
}

如何解决此问题,我应该将SDK降级到27吗?或使用Glide?

谢谢

2 个答案:

答案 0 :(得分:11)

尝试一下:

muParser

答案 1 :(得分:0)

最简单的修复方法是为存在此问题的库添加匹配版本(如我所说)。

但是现在,如下更改依赖关系:

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:support-annotations:28.0.0' // Like this

或者您也可以尝试将com.android.support:support-annotations覆盖为v 28.0.0

如果这样做没有帮助,因为我已经检查了Picasso is updated to 28.0.0和支持库,那么它使用的库可能仍在使用27.1.0

因此您可以降级为27.1.0,或使用Glide

我不想判断这些库,但是对于新版本,我更喜欢Glide,即使对于Kotlin,它也具有更好的文档,并且对新API使用快照。因此,请将此作为最后选择,或者只需添加最新版本并使用它即可。