Я не могу понять эту ОШИБКУ: в проекте «приложение» разрешенная зависимость библиотеки сервисов Google Play зависит от другого в точной версии - PullRequest
0 голосов
/ 31 октября 2019

Я пытаюсь добавить Firebase в существующий проект. Вы можете увидеть полный проект здесь: https://github.com/UdacityAndroidDevScholarship/blood-donation

Я уже добавил весь Firebase SDK. В проекте gradle.build я добавил classpath 'com.google.gms:google-services:4.3.2' в проект gradle.build.

Но когда я добавляю implementation 'com.google.firebase:firebase-analytics:17.2.0' в приложение gradle.build, я сталкиваюсь со следующей ошибкой

ОШИБКА: В проекте «приложение» разрешенная зависимость библиотеки служб Google Play зависит от другой в конкретной версии (например, «[15.0. 1]», но не разрешается в этой версии. Поведение, демонстрируемое библиотекой, будетнеизвестно.

Сбой зависимости: com.google.android.gms: play-services-flags: 15.0.1 -> com.google.android.gms: play-services-basement @ [15.0.1],но версия play-services-basement была 17.0.0.

Следующие зависимости являются проектными зависимостями, которые являются прямыми или имеют транзитивные зависимости, которые приводят к искусственному решению проблемы. - Проект 'app' зависит от ком.google.android.gms: play-services-measure @ {строго 17.2.0} - «Приложение» проекта зависит от com.google.firebase: firebase-database-collection @ {строго 15.0.1} - приложение «Проект»'зависит от com.google.android.gms: play-services-maps@15.0.0 - «Приложение» проекта зависит от com.google.android.gms: play-services-maps @ {строго 15.0.0}

Для расширенной отладочной информации выполнитеВыполните Gradle из командной строки с помощью ./gradlew --info: app: assemblyDebug, чтобы увидеть пути зависимости от артефакта. Это сообщение об ошибке пришло из плагина google-services Gradle, сообщите о проблемах по адресу https: // github.com/google/play-services-plugins и отключите его, добавив «googleServices {disableVersionCheck = false}» в файл b uild.gradle.

Здесь мое приложение gradle.build

apply plugin: 'com.android.application'

android {
    compileSdkVersion buildConfig.compileSdk

    defaultConfig {
        applicationId "com.udacity.nanodegree.blooddonation"
        minSdkVersion buildConfig.minSdk
        targetSdkVersion buildConfig.targetSdk
        versionCode buildConfig.version.code
        versionName buildConfig.version.name
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {

        debug {
            debuggable true
        }

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        buildTypes.each {
            it.resValue('string', "google_maps_key", propOrThrow('GOOGLE_MAPS_API_KEY'))
        }
    }

    lintOptions {
        textReport true
        textOutput 'stdout'
        lintConfig rootProject.file('lint.xml')

        checkDependencies true
        checkTestSources true
        explainIssues false
    }


    dataBinding {
        enabled = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    // Support lib
    implementation deps.android.support.appcompatV7

    // Support Design
    implementation deps.android.support.design

    // Constraint layout
    implementation deps.android.support.constraintLayout

    //FireBase Analytics

    implementation 'com.google.firebase:firebase-analytics:17.2.0'

    // Firebase Auth
    implementation deps.google.firebase.auth

    // Realtime database
    implementation deps.google.firebase.database

    //Country code picker
    // https://android-arsenal.com/details/1/5753 // TODO: move to project level gradle
    implementation 'com.github.joielechong:countrycodepicker:2.1.5'

    // Leak canary
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    debugImplementation deps.square.leackcanary.debug
    releaseImplementation deps.square.leackcanary.release

    // Timber - Logging library
    implementation deps.other.timber

    // Fused location
    implementation deps.google.play_services.location

    // Geo-fire
    implementation deps.google.firebase.geo_fire

    // Map
    implementation deps.google.play_services.maps

    // PinView // TODO: move to project level gradle
    implementation 'com.github.GoodieBag:Pinview:v1.3'

    implementation deps.google.gson.gson

    implementation deps.google.firebase.cloud_messaging



    testImplementation deps.junit

    androidTestImplementation deps.android.support.test.runner
    androidTestImplementation deps.android.support.test.espressoCore

}


apply plugin: 'com.google.gms.google-services'

Но при удалении implementation 'com.google.firebase:firebase-analytics:17.2.0' ошибка исчезла. Но проблема в том, что на консоли Firebase нет аналитики. Я знаю, что есть дублированные зависимости. Но я не знаю, что удалить или что изменить. Пожалуйста, помогите

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...