Настройки облачного хранилища сообщений Firebase - PullRequest
0 голосов
/ 15 марта 2019

Я пытаюсь добавить облачные сообщения Firebase в свое приложение, но проблема в моих зависимостях

Это то, что я добавляю в мои зависимости:

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

но это не работает, в итоге появляются ошибки.

Мой проект Gradle:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'

        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Мой App gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.my.package"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 12
        versionName "12.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }
}

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.android.support:support-v4:28.0.0'
    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.0.0'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'de.hdodenhof:circleimageview:2.0.0'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'
    implementation 'com.cocosw:bottomsheet:1.+@aar'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.github.ybq:AndroidSpinKit:v1.0.0'
    implementation 'com.google.android.gms:play-services-ads:17.1.2'
}
apply plugin: 'com.google.gms.google-services'

Ошибка Logcat

logcat Любое решение ??Я также попытался обновить все зависимости до их новой версии, но это также не сработало.

Ответы [ 2 ]

1 голос
/ 15 марта 2019

Взгляните на Примечания к выпуску Firebase Android для последних версий, доступных для различных ядер функций Firebase .

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

Попробуйте обновить его до последней доступной версии.

0 голосов
/ 15 марта 2019

Попробуйте, изменив версию Gradle, это работало у меня раньше, я тоже столкнулся с той же проблемой несколько дней назад

classpath 'com.android.tools.build:gradle:3.2.1'
...