android面临崩溃报告仅适用于8.0和8.1中的firebase通知

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android面临崩溃报告仅适用于8.0和8.1中的firebase通知相关的知识,希望对你有一定的参考价值。

这是我面临的崩溃。请说出可能的解决方案

例外是

java.lang.IllegalStateException

android.app.ContextImpl.startServiceCommon

报告是

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3194)
  at android.app.ActivityThread.-wrap17 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1672)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6494)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: 
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1521)
  at android.app.ContextImpl.startService (ContextImpl.java:1477)
  at android.content.ContextWrapper.startService (ContextWrapper.java:650)
  at android.content.ContextWrapper.startService (ContextWrapper.java:650)
  at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:91)
  at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzj (Unknown Source:11)
  at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb (Unknown Source:72)
  at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive (Unknown Source:25)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3187)

但是,我觉得我使用的firebase版本较低,但它也不允许我在build.gradle()中添加更高版本。

Build.gradle依赖项

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'
        exclude group: 'com.google.code.findbugs'
    })
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'org.apache.commons:commons-lang3:3.5'
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support:cardview-v7:26.+'
    compile 'com.android.support:recyclerview-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
    compile 'com.android.support:design:26.+'
    compile 'com.wdullaer:swipeactionadapter:2.0.0'
    compile 'me.biubiubiu.justifytext:library:1.1'
    compile 'jp.wasabeef:blurry:2.1.1'
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.github.kulik:android-jaxb:0.3'
    compile 'com.google.firebase:firebase-messaging:9.2.1'
    //    compile files('libs/jaxb-api-2.2.4.jar')
    compile files('libs/dnd-4.2-SNAPSHOT-jar-with-dependencies.jar')
    compile 'org.jsoup:jsoup:1.10.2'
}
答案

您应该将firebase库更新为最新版本(现在是11.8.0),因为Android O背景限制(docs

以上是关于android面临崩溃报告仅适用于8.0和8.1中的firebase通知的主要内容,如果未能解决你的问题,请参考以下文章

Android崩溃报告库(Froyo之前)[重复]

任何适用于 iOS 的良好崩溃报告服务 [关闭]

JSON仅适用于Debug模式,但不适用于android中的apk文件

位置侦听器适用于 Android 6.0 但不适用于 android 8.0+ [关闭]

Android Autofill 仅适用于来自 onFillRequest 而不是来自身份验证活动的响应

ANDROID STUDIO - 电视应用程序(我的安卓电视应用程序仅适用于模拟器电视)