Android中的FirebaseInstallation类崩溃

Android中的FirebaseInstallation类崩溃,android,firebase,push-notification,Android,Firebase,Push Notification,Firebase Crashlytics一直在报道大量在playstore上安装了安卓8和安卓6的设备发生故障。 我们也在应用程序中使用dexguard 我使用的环境和组件如下所示 projectbuild.gradle classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' // Crashlytics plugin classpath 'com.google.firebase:perf-plugin:1.3.1'

Firebase Crashlytics一直在报道大量在playstore上安装了安卓8和安卓6的设备发生故障。 我们也在应用程序中使用dexguard

我使用的环境和组件如下所示

projectbuild.gradle

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' // Crashlytics plugin
classpath 'com.google.firebase:perf-plugin:1.3.1'  // Performance Monitoring plugin
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
implementation 'com.google.firebase:firebase-perf:19.0.7'
应用程序build.gradle

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' // Crashlytics plugin
classpath 'com.google.firebase:perf-plugin:1.3.1'  // Performance Monitoring plugin
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
implementation 'com.google.firebase:firebase-perf:19.0.7'
这些是我从Crashlytics得到的日志

???
com.google.firebase.installations.FirebaseInstallations.INotificationSideChannel$Stub$Proxy

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at com.google.firebase.installations.FirebaseInstallations.INotificationSideChannel$Stub$Proxy(:452)
at com.google.firebase.installations.FirebaseInstallations.INotificationSideChannel$Stub$Proxy(:331)
at com.google.firebase.installations.FirebaseInstallations.INotificationSideChannel$Stub$Proxy(:296)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$3.run(:2)
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 SDK版本,因为在引擎盖下存在许多相互依赖性

现在,我建议使用(物料清单)管理所有SDK版本。这允许您只指定一次版本(BoM表的版本),然后包括所有其他SDK而不指定版本

要在您的问题中使用最新的BoM和SDK,它将如下所示:

implementation platform('com.google.firebase:firebase-bom:26.0.0')

implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'

如果您想查看(或比较)某个BoM版本中包含哪些SDK版本,请选中此项。

firebase已在其最新版本中修复了此问题。我使用的是以前的版本,现在更新到了最新的版本。有关更多信息,请访问此链接


不确定为什么会在FCM下标记此项(暂时删除)。在撞车之前是否有与FCM相关的更新?或者像推送notif发送,可能导致崩溃?我们不确定这是为什么,因为我们只有来自crashlytics的跟踪。它可能与导致这种情况的推力有关,但仍不确定。