1

我的应用程序集成了FCM来接收推送通知,它工作正常。但是,我面临着安装时随机崩溃的问题。这是非常随机的,并且发生在OS 6.0或更高版本的设备,直到最新的,但随机发生。无法启动接收器com.google.firebase.iid.FirebaseInstanceIdInternalReceiver

明智的代码,在服务类中只显示通知代码,并在manifest中添加服务。

我的应用程序加载

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) 
+0

你跟构建哪种版本的火力地堡库? –

+0

我认为你需要10.2.1或更高版本。 –

+0

好让我试试。感谢您的回复 – VVB

回答

0

获得例外低于使用这个库版本火力

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' 
相关问题