Android 使用goolge analytics时如何解决firebase非法状态异常

Android 使用goolge analytics时如何解决firebase非法状态异常,android,google-analytics,Android,Google Analytics,计划 dependencies { classpath 'com.google.gms:google-services:3.0.0' } 模块 dependencies { compile 'com.google.android.gms:play-services-analytics:10.0.0' } 这只是发生在8.0系统中,但我还没有在我的项目中使用任何firebase代码 Fatal Exception: java.lang.IllegalStateException:

计划

dependencies {
   classpath 'com.google.gms:google-services:3.0.0'
}
模块

dependencies {
    compile 'com.google.android.gms:play-services-analytics:10.0.0'
}
这只是发生在8.0系统中,但我还没有在我的项目中使用任何firebase代码

Fatal Exception: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) }: app is in background uid UidRecord{e2ab7c6 u0a30 CEM  idle procs:1 seq(0,0,0)}
           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 com.google.firebase.iid.zzf.zzbi(Unknown Source:149)
           at com.google.firebase.iid.zzf.zzbi(Unknown Source:235)
           at com.google.firebase.iid.zzf.zzt(Unknown Source:20)
           at com.google.firebase.iid.zzf.zzbi(Unknown Source)
           at com.google.firebase.iid.zzd.zzGu(Unknown Source:57)
           at com.google.firebase.iid.zzd.getCreationTime(Unknown Source:49)
           at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source:3)
           at com.google.firebase.iid.FirebaseInstanceId.zzaae(Unknown Source:4)
           at com.google.firebase.iid.FirebaseInstanceIdService.zzH(Unknown Source:37)
           at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source:35)
           at com.google.firebase.iid.zzb$2.run(Unknown Source:4)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
           at java.lang.Thread.run(Thread.java:764)
我无法从我的项目中删除firebase,是否有其他方法解决此问题


您应该首先在主菜单上尝试,选择文件|使缓存无效/重新启动。如果Android studio处于不良状态,则可能发生这种情况。
还应注意的是,firebase可能正在使用服务分析。自从谷歌收购了firebase之后,他们已经在许多google play服务库中安装了firebase。

添加代码,原因是什么?fabric crashlytics显示它是由android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538)引起的。我不知道问题的原因是什么。fabric报告您是否能够解决这个问题。我在申请中也遇到了这个问题@对于开发者来说,这个错误只会在Google play控制台中报告,而不会在fabric中报告。