无法启动接收器com.google.firebase.iid.FirebaseInstanceIdInternalReceiver [英] Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver

查看:361
本文介绍了无法启动接收器com.google.firebase.iid.FirebaseInstanceIdInternalReceiver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序集成了FCM以接收推送通知,并且可以正常运行.但是,我面临的问题是在安装时它会随机崩溃.这是非常随机的,并且一直在OS 6.0+设备上发生,直到最近,但是随机发生.

My app integrates FCM to receive push notifications and it works okay. However, I am facing issue that on installation it crashes randomly. It is very random and occurring on OS 6.0+ devices till latest but randomly occurs.

明智的做法是,在服务类中仅显示通知代码,并将其添加到清单中.

Code wise, in service class only show notification code is written and added service in manifest.

我在应用程序加载方面遇到了异常情况

I am getting below exception on app loads

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.xx.xx cmp=com.xx.xx/com.google.firebase.iid.FirebaseInstanceIdService (has extras) }: app is in background uid UidRecord{997e286 u0a92 RCVR idle procs:1 seq(0,0,0)}
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3259)
       at android.app.ActivityThread.-wrap17(Unknown Source)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6540)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.xx.xx cmp=com.xx.xx/com.google.firebase.iid.FirebaseInstanceIdService (has extras) }: app is in background uid UidRecord{997e286 u0a92 RCVR idle procs:1 seq(0,0,0)}
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1497)
       at android.app.ContextImpl.startService(ContextImpl.java:1453)
       at android.content.ContextWrapper.startService(ContextWrapper.java:644)
       at android.content.ContextWrapper.startService(ContextWrapper.java:644)
       at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService(WakefulBroadcastReceiver.java:91)
       at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh(Unknown Source:12)
       at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb(Unknown Source:76)
       at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive(Unknown Source:28)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3252)
       at android.app.ActivityThread.-wrap17(Unknown Source)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6540)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

推荐答案

将此库版本用于Firebase

Use this library version for firebase

compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'

这篇关于无法启动接收器com.google.firebase.iid.FirebaseInstanceIdInternalReceiver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆