FCM通知的有效代码现在无法正常工作?

时间:2019-02-11 06:50:30

标签: android firebase firebase-notifications

我正在一个使用firebase通知过程的android项目中工作,并且直到上周都可以正常工作,但是应用程序无法从服务器接收通知,并且在该过程中出现错误。

我不明白里面发生了什么!

有人可以建议我怎么做吗?

我的logcat错误

    02-11 12:03:49.744 613-650/? W/qcom_sensors_hal: hal_sensor1_data_cb: SENSOR1_MSG_TYPE_BROKEN_PIPE
02-11 12:03:49.803 12473-12473/? E/Diag_Lib:  Diag_LSM_Init: Failed to open handle to diag driver, error = 2
02-11 12:03:49.803 12473-12473/? E/Sensors: sns_fsa_la.c(386):fsa: fflush failed, 9
02-11 12:03:49.803 12473-12473/? E/Sensors: sns_fsa_la.c(386):fsa: fflush failed, 9
02-11 12:03:49.835 12473-12475/? W/Sensors: sns_smr_la.c(446):smr_la: smr_apps_la_thread_main is starting, fd=11, sns_smr.en_rx_msg_ptr=b6feba04
02-11 12:03:49.917 12473-12477/? W/Sensors: sns_sam_app.c(6827):sns_sam_reg_algo: Registering algo service 16, err 0
02-11 12:03:49.928 12473-12479/? E/Sensors: sns_debug_main.c(565):Debug Config File missing in EFS!

上周,我测试了此代码,以通知它可以正常工作,但是现在不起作用,并且我也没有更改该代码部分中的任何内容。

我的网格文件(应用程序)

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.flaviofaria:kenburnsview:1.0.7'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.squareup.okhttp3:okhttp:3.2.0'
    implementation 'com.nex3z:notification-badge:0.1.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:gridlayout-v7:26.1.0'
}
apply plugin: 'com.google.gms.google-services'

grid文件(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:3.2.0'

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

1 个答案:

答案 0 :(得分:0)

使用最新更新文件

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