Ошибка при интеграции FireBase в android Studio - PullRequest
0 голосов
/ 04 апреля 2020

Я пытаюсь интегрировать Firebase в мой проект android, но постоянно получаю сообщение об ошибке «В приложении проекта» разрешенная зависимость библиотеки сервисов Google Play зависит от другого в конкретной версии (например, «[17.0. 4]», но не разрешается до этой версии. Поведение, демонстрируемое библиотекой, будет неизвестно.

Зависимость не работает: com.google.firebase: firebase-message: 17.3.4 -> com.google.firebase: firebase -iid @ [17.0.4], но версия fire base-iid была 20.0.2. "

мой код для сборки приложения gdle - -------

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.goldfish"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
 'proguard-rules.pro'
        }
    }
    packagingOptions {
        // Exclude file to avoid
        // Error: Duplicate files during packaging of APK
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation "com.google.firebase:firebase-messaging:17.3.4"
    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.google.firebase:firebase-analytics:17.2.2'


}

1 Ответ

0 голосов
/ 04 апреля 2020

Обновление до последних версий библиотек Firebase:

implementation 'com.google.firebase:firebase-messaging:20.1.5'
implementation 'com.google.firebase:firebase-analytics:17.3.0'
...