Android应用程序崩溃异常

时间:2018-07-02 13:30:11

标签: android firebase firebase-cloud-messaging

我坚持使用下面的Android应用程序崩溃报告,每个人都知道确切的问题是什么以及如何解决。

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3397)
  at android.app.ActivityThread.-wrap18 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6938)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Caused by: java.lang.IllegalStateException: 
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538)
  at android.app.ContextImpl.startService (ContextImpl.java:1484)
  at android.content.ContextWrapper.startService (ContextWrapper.java:663)
  at android.content.ContextWrapper.startService (ContextWrapper.java:663)
  at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:91)
  at com.google.firebase.iid.zzg.b (zzg.java:9)
  at com.google.firebase.iid.zzg.a (zzg.java:72)
  at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive (FirebaseInstanceIdInternalReceiver.java:31)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3390)
  at android.app.ActivityThread.-wrap18 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6938)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

1 个答案:

答案 0 :(得分:1)

似乎您正在尝试从后台线程启动Service。从Background Execution Limits开始,不再支持Oreo。页面底部有一个迁移指南。