Marvix
Marvix

Reputation: 181

Android Picasso gives mixing versions error

I`m getting an error due to mixing versions

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-rc01, 27.1.0. Examples include 'com.android.support:animated-vector-drawable:28.0.0-rc01' and 'com.android.support:exifinterface:27.1.0'

The com.android.support:exifinterface:27.1.0 is coming under Picasso, maybe with Picasso, since I added version 28, yet Picasso still using version 27, and Volley is using version 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'
}

How to fix this issue, should I downgrade the SDK to 27? or use Glide?

Thanks,

Upvotes: 7

Views: 3362

Answers (2)

Makoto Hata
Makoto Hata

Reputation: 301

Try it:

implementation ('com.squareup.picasso:picasso:2.71828') {
        exclude group: 'com.android.support'
        exclude module: ['exifinterface', 'support-annotations']
}

Upvotes: 19

ʍѳђઽ૯ท
ʍѳђઽ૯ท

Reputation: 16976

The easiest fix will be adding the match version for the libraries which has this issue(Like I said).

But now, change the dependencies as follows:

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

Or you can try to override com.android.support:support-annotations to v 28.0.0 too.

If this didn't help, since I've checked and picasso is updated to 28.0.0 support library, then perhaps the libraries it uses is still using 27.1.0.

So you can downgrade to 27.1.0, or use Glide.

I don't want to judge the libraries but with the new versions, I prefer the Glide one which has better documentation even for Kotlin and using snapshots for the new APIs. So consider this as the last choice or, simply add the latest version and use it.

Upvotes: 0

Related Questions