Конфликты в библиотеках gms / firebase в зависимостях gradle для Android - PullRequest
0 голосов
/ 30 мая 2018

У меня конфликт в com.google.android.gms:play-services-ads:15.0.1.

Я получаю следующую ошибку:

Все библиотеки gms / firebase должны использовать одну и ту же спецификацию версий (смешивание версий можетпривести к сбоям во время выполнения).Найдено версии 16.0.1, 16.0.0, 15.0.4, 15.0.1, 15.0.0.Примеры включают com.google.firebase: база данных firebase: 16.0.1 и com.google.firebase: аналитика firebase: еще 16.0.0 ... (Ctrl + F1)

Это мойнастройки gradle:

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'

implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'

implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'

implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

implementation 'com.google.android.exoplayer:exoplayer:2.8.0'
implementation 'com.google.android.exoplayer:extension-rtmp:2.8.0'
implementation 'com.google.android.exoplayer:extension-mediasession:2.8.0'

implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'io.github.kobakei:ratethisapp:1.1.1'
testImplementation 'junit:junit:4.12'

implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true
}
}
// Firebase plugin
apply plugin: 'com.google.gms.google-services'

Дополнительная информация:

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId 'com.example.home.radio'
    minSdkVersion 21
    targetSdkVersion 27
    versionCode 49
    versionName "2.4.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Дополнительная информация:

buildscript {
repositories {
    jcenter()
    mavenCentral()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.0.1'
    classpath 'com.novoda:bintray-release:0.5.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

Я загрузил проект с веб-сайта Firebase и обнаружил, что он точно такой жепроблема, я думаю, что проблема с конца firebase.

Ответы [ 2 ]

0 голосов
/ 30 мая 2018

Добавьте явно библиотеку со старой версией, но с новым номером версии.И: не забудьте нажать синхронизацию сейчас, чтобы gradle мог перестроить граф зависимостей и посмотреть, есть ли еще конфликты.

Для вашего случая вы можете попробовать изменить:

implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0'

до

implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
0 голосов
/ 30 мая 2018

убедитесь, что вы используете наиболее подходящие версии (необязательно тот же номер версии) - прочитайте это https://developers.google.com/android/guides/setup

//like this(for example)
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...