Добавление Firebase конфликтует с сервисами Google Play - PullRequest
0 голосов
/ 14 ноября 2018

После добавления Firebase в мое приложение, чтобы я мог отправлять push-уведомления пользователям через appcenter, я столкнулся с рядом проблем.

В настоящее время у меня возникла проблема слияния двух библиотек.

Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-basement is being 
requested by various other libraries at [[15.0.1,15.0.1]], but 
resolves to 16.0.1. Disable the plugin and check your dependencies 
tree using ./gradlew :app:dependencies.

Как вы можете видеть здесь, у меня нет конкретных зависимостей для play-services-basement ...

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'io.realm:realm-gradle-plugin:5.3.1'
    }
}


apply plugin: 'com.android.application'

apply plugin: 'io.fabric'

apply plugin: 'realm-android'

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

realm {
    syncEnabled = true
}

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.xxxxsoftware.xxxx.xxxx"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 36
        versionName "2.8.17"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {

        checkReleaseBuilds false

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

dependencies {
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
        transitive = true
    }
    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 fileTree(include: ['*.jar'], dir: 'libs')
    def appCenterSdkVersion = '1.9.0'

    implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
    implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
    implementation "com.microsoft.appcenter:appcenter-push:${appCenterSdkVersion}"

    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.google.zxing:core:3.3.3'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:support-vector-drawable:28.0.0'

    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
    implementation 'com.github.delight-im:Android-SimpleLocation:v1.0.1'
    implementation 'io.nlopez.smartlocation:library:3.3.3'
    implementation 'io.realm:android-adapters:3.0.0'
    implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.3'
    implementation 'com.journeyapps:zxing-android-embedded:3.1.0@aar'
    implementation 'com.github.pwittchen:reactivenetwork-rx2:2.0.0'
}

Я выполнил команду ./gradlew: app: зависимости, и она выводит:

* What went wrong:
Project 'app' not found in root project 'ChimePassportAndroid'.

1 Ответ

0 голосов
/ 14 ноября 2018

Чтобы использовать обмен сообщениями Firebase, вам необходимо добавить в ваш файл build.gradle соответствующую зависимость, например:

implementation 'com.google.firebase:firebase-messaging:17.3.4'

И ваша проблема будет решена.

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