Alan Lin
Alan Lin

Reputation: 85

android gradle com.android.support libraries version issue

When i build my gradle, i got a error. Hint shows:

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

This is my gradle:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':rest')
// Google
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services:10.2.4'


// Analytics
// Fabric + Crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}
compile 'com.google.android.gms:play-services-analytics:10.2.4'
compile 'com.google.firebase:firebase-core:10.0.1'

// Facebook
compile 'com.facebook.android:facebook-android-sdk:4.+'
// Tools
// App Intro
compile 'com.github.paolorotolo:appintro:4.1.0'
// FloatingActionButton menu
compile 'com.github.clans:fab:1.6.1'
// Animation items for RecyclerView
compile 'jp.wasabeef:recyclerview-animators:2.0.1'
// Photo banner
compile 'com.bigkoo:convenientbanner:2.0.5'
// Time picker support for 4.0+
compile 'com.wdullaer:materialdatetimepicker:2.5.0'
// Displays the relative time with respect to the reference point
compile 'com.github.curioustechizen.android-ago:library:1.3.0'
compile 'com.paypal.sdk:paypal-android-sdk:2.15.0'
// Image loader (for high resolution pics)
compile 'com.github.bumptech.glide:glide:3.7.0'
// Icon font
compile "com.mikepenz:iconics-core:2.8.1@aar"
compile 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
compile 'com.mikepenz:material-design-iconic-typeface:2.2.0.2@aar'
compile 'com.wang.avi:library:2.1.3'

compile 'com.tomergoldst.android:tooltips:1.0.6'
}

I also follow this answer Change

compile 'com.android.support:design:25.3.1'

to

compile 'com.android.support:design:27.0.2'

However, after i sync my project. The hint shows:

This support library should not use a different version(27) than the compileSdkVersion(25)

Upvotes: 2

Views: 1200

Answers (2)

marcrobito
marcrobito

Reputation: 23

I had the same issue, in my case was related to the facebook sdk version use 4.33.0 instead of 4.+ and update your support librareis to version 27.0.2

Upvotes: 1

Levi Moreira
Levi Moreira

Reputation: 11995

Make sure to use the latest version for your support libs (27.1.1). Also change from compile to implementation, compile has been deprecated. Finally, change your compileSdkVersion to 27 in your app level build.gradle file.

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile project(':rest')
// Google
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.android.gms:play-services:10.2.4'


// Analytics
// Fabric + Crashlytics
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}
implementation 'com.google.android.gms:play-services-analytics:10.2.4'
implementation 'com.google.firebase:firebase-core:10.0.1'

// Facebook
implementation 'com.facebook.android:facebook-android-sdk:4.+'
// Tools
// App Intro
implementation 'com.github.paolorotolo:appintro:4.1.0'
// FloatingActionButton menu
implementation 'com.github.clans:fab:1.6.1'
// Animation items for RecyclerView
implementation 'jp.wasabeef:recyclerview-animators:2.0.1'
// Photo banner
implementation 'com.bigkoo:convenientbanner:2.0.5'
// Time picker support for 4.0+
implementation 'com.wdullaer:materialdatetimepicker:2.5.0'
// Displays the relative time with respect to the reference point
implementation 'com.github.curioustechizen.android-ago:library:1.3.0'
implementation 'com.paypal.sdk:paypal-android-sdk:2.15.0'
// Image loader (for high resolution pics)
implementation 'com.github.bumptech.glide:glide:3.7.0'
// Icon font
implementation "com.mikepenz:iconics-core:2.8.1@aar"
implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.2@aar'
implementation 'com.wang.avi:library:2.1.3'

implementation 'com.tomergoldst.android:tooltips:1.0.6'
}

Upvotes: 0

Related Questions