Android Studio - предупреждение gradle: все библиотеки com.android.support должны использовать одну и ту же спецификацию версии - PullRequest
0 голосов
/ 30 января 2019

Я получил предупреждение в строке ниже

implementation 'com.android.support:appcompat-v7:28.0.0'

Предупреждение:

All com.android.support libraries must use the exact same version specification 
(mixing versions can lead to runtime crashes). 
Found versions 28.0.0, 24.0.0. 
Examples include com.android.support:animated-vector-drawable:28.0.0 
and com.android.support:mediarouter-v7:24.0.0
Inspection info:There are some combinations of libraries, or tools and libraries, 
that are incompatible, or can lead to bugs. 
One such incompatibility is compiling with a version of 
the Android support libraries that is not the latest version 
(or in particular, a version lower than your targetSdkVersion).  
Issue id: GradleCompatible

Ниже приведен мой код build.gradle (app) (Новое обновление для библиотек Firebase)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.vanessa.orderfoodserver"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //Add Library
    implementation 'com.jaredrummler:material-spinner:1.1.0'

    //Firebase
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.firebaseui:firebase-ui-database:4.3.1'
    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.google.firebase:firebase-core:16.0.6'

    //Received the warning at below line
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'

    implementation 'com.google.android.gms:play-services-maps:10.2.0'
    implementation 'com.google.android.gms:play-services:10.2.0' //ForLocation
    testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Я пытался добавить

com.android.support:support-v4:28.0.0
com.android.support:animated-vector-drawable:28.0.0
com.android.support:mediarouter-v7:28.0.0

, но предупреждение все еще существует.

Я могу запустить свое приложение, но я все еще хочу исправить это предупреждение.Спасибо!

Ответы [ 2 ]

0 голосов
/ 31 января 2019

Мое предложение для вас, попробуйте заглянуть в каждую последнюю версию каждой отдельной библиотеки для вашего проекта.Некоторые библиотеки даже не одинаковы по отношению друг к другу.Lib A ver может быть 2.0, а Lib B ver может быть 2.5, но оба являются последними (например, Firebase).Эта версия библиотеки зависимостей является частью Android Studio 3.0. + Миграция.

0 голосов
/ 30 января 2019
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.1.0'

или попробуйте

 implementation 'com.android.support:appcompat-v7:28.0.0'
 implementation 'com.android.support:animated-vector-drawable:28.0.0'
 implementation 'com.android.support:exifinterface:28.0.0'
 implementation 'com.android.support:cardview-v7:28.0.0'
 implementation 'com.android.support:customtabs:28.0.0'
 implementation 'com.android.support:support-media-compat:28.0.0'
 implementation 'com.android.support:support-v4:28.0.0'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...