android gradle com.android.support库版本问题

时间:2018-05-15 17:09:29

标签: android android-studio build.gradle

当我建立我的gradle时,我收到了一个错误。提示显示:

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

这是我的傻瓜:

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'
}

我也遵循这个answer 改变

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

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

然而,在我同步我的项目之后。提示显示:

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

2 个答案:

答案 0 :(得分:1)

我有同样的问题,在我的情况下与facebook sdk版本使用4.33.0相关而不是4. +并更新你的支持librareis到版本27.0.2

答案 1 :(得分:0)

确保使用支持库的最新版本(27.1.1)。也从编译更改为实现,编译已被弃用。最后,在app level level build.gradle文件中将compileSdkVersion更改为27。

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'
}