使用Firebase通知

时间:2017-09-15 06:26:50

标签: android firebase firebase-notifications firebase-crash-reporting

我在我的应用程序中使用Firebase,当我从Firebase发送通知时,我的应用程序将崩溃。我在我的应用程序中添加了Firebase崩溃报告,但是在firebase控制台中,到目前为止,我的应用程序中没有任何崩溃。

'com.google.firebase:firebase-crash:10.0.1'

这是我的Gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "codenevisha.com.apps.bartarinapp"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

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

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })



    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    //Image Slider
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'me.relex:circleindicator:1.2.2@aar'


    //Google service GMS location
    compile 'com.google.android.gms:play-services-location:11.0.4'

    //Retrofit
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'

    //Circular Menu
    compile 'com.github.Hitomis:CircleMenu:v1.1.0'

    //Universal Image Loader
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    //Lottie
    compile 'com.airbnb.android:lottie:2.2.0'

    //FireBase
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-crash:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'

    testCompile 'junit:junit:4.12'
}

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

这是我遇到崩溃时的日志猫:

codenevisha.com.apps.bartarinapp E/Trace: error opening trace file: No such file or directory (2)
codenevisha.com.apps.bartarinapp A/FirebaseApp: Firebase API initialization failure.
                                                java.lang.reflect.InvocationTargetException
                                                    at java.lang.reflect.Method.invokeNative(Native Method)
                                                    at java.lang.reflect.Method.invoke(Method.java:511)
                                                    at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                    at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                    at android.content.ContentProvider.attachInfo(ContentProvider.java:1058)
                                                    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                    at android.app.ActivityThread.installProvider(ActivityThread.java:4819)
                                                    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432)
                                                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
                                                    at android.app.ActivityThread.access$1300(ActivityThread.java:141)
                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
                                                    at android.os.Handler.dispatchMessage(Handler.java:99)
                                                    at android.os.Looper.loop(Looper.java:137)
                                                    at android.app.ActivityThread.main(ActivityThread.java:5041)
                                                    at java.lang.reflect.Method.invokeNative(Native Method)
                                                    at java.lang.reflect.Method.invoke(Method.java:511)
                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
                                                    at dalvik.system.NativeStart.main(Native Method)
                                                 Caused by: java.lang.ExceptionInInitializerError
                                                    at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                    at java.lang.reflect.Method.invoke(Method.java:511) 
                                                    at com.google.firebase.FirebaseApp.zza(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
                                                    at android.content.ContentProvider.attachInfo(ContentProvider.java:1058) 
                                                    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
                                                    at android.app.ActivityThread.installProvider(ActivityThread.java:4819) 
                                                    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432) 
                                                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372) 
                                                    at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) 
                                                    at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                    at android.os.Looper.loop(Looper.java:137) 
                                                    at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                    at java.lang.reflect.Method.invoke(Method.java:511) 
                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
                                                    at dalvik.system.NativeStart.main(Native Method) 
                                                 Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzapn
                                                    at com.google.android.gms.internal.zzbku.<clinit>(Unknown Source)
                                                    at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source) 
                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                    at java.lang.reflect.Method.invoke(Method.java:511) 
                                                    at com.google.firebase.FirebaseApp.zza(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                    at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
                                                    at android.content.ContentProvider.attachInfo(ContentProvider.java:1058) 
                                                    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
                                                    at android.app.ActivityThread.installProvider(ActivityThread.java:4819) 
                                                    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432) 
                                                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372) 
                                                    at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) 
                                                    at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                    at android.os.Looper.loop(Looper.java:137) 
                                                    at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                    at java.lang.reflect.Method.invoke(Method.java:511) 
                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
                                                    at dalvik.system.NativeStart.main(Native Method) 
codenevisha.com.apps.bartarinapp E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.internal.zzbgz.zzf
codenevisha.com.apps.bartarinapp E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.google.android.gms.internal.zzcjg.zzzq
codenevisha.com.apps.bartarinapp E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.google.android.gms.internal.zzcjg.zzs
codenevisha.com.apps.bartarinapp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
codenevisha.com.apps.bartarinapp E/FA: Discarding data. Failed to send app launch
codenevisha.com.apps.bartarinapp E/FA: Failed to get app instance id
codenevisha.com.apps.bartarinapp E/FA: Failed to send current screen to service
codenevisha.com.apps.bartarinapp E/FA: Discarding data. Failed to send event to service
codenevisha.com.apps.bartarinapp E/FA: Failed to send current screen to service
codenevisha.com.apps.bartarinapp E/FA: Discarding data. Failed to send event to service
codenevisha.com.apps.bartarinapp E/FA: Failed to send current screen to service
codenevisha.com.apps.bartarinapp E/FA: Discarding data. Failed to send event to service
codenevisha.com.apps.bartarinapp E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
                                                   java.lang.AbstractMethodError: abstract method not implemented
                                                       at com.google.firebase.iid.zzb.handleIntent(Unknown Source)
                                                       at com.google.firebase.iid.zzc.run(Unknown Source)
                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
                                                       at java.lang.Thread.run(Thread.java:856)
codenevisha.com.apps.bartarinapp E/FA: Failed to send current screen to service
codenevisha.com.apps.bartarinapp E/FA: Discarding data. Failed to send event to service

0 个答案:

没有答案