使用Firebase发送推送通知后,仅在极少数设备上出现NullPointerException [英] NullPointerException only on very very few devices after sending Push Notification using Firebase

查看:73
本文介绍了使用Firebase发送推送通知后,仅在极少数设备上出现NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我首先说,我已经看过数百万的NullPointerExceptions,而且我知道如何修复它们.

Let me start off by saying, I've seen millions of NullPointerExceptions, and I know how to fix them.

但是最近(也许从一个月前开始?),当我使用FCM发送推送通知时,我已经开始在很少的设备中接收到NullPointerException.

But lately (maybe from a month ago?), I've started receiving NullPointerException in very very few devices when I send a push notification using FCM.

这是我在Play控制台的Android Vitals中看到的堆栈跟踪.

This is the stack trace I see in Android Vitals of Play Console.

java.lang.NullPointerException: 
  at com.android.okhttp.okio.Buffer.write (Buffer.java:1182)
  at com.android.okhttp.okio.Buffer.read (Buffer.java:1221)
  at com.android.okhttp.okio.RealBufferedSource.read (RealBufferedSource.java:65)
  at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read (Http1xStream.java:602)
  at com.android.okhttp.internal.Util.skipAll (Util.java:172)
  at com.android.okhttp.internal.Util.discard (Util.java:154)
  at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.close (Http1xStream.java:619)
  at com.android.okhttp.okio.RealBufferedSource.close (RealBufferedSource.java:421)
  at com.android.okhttp.okio.RealBufferedSource$1.close (RealBufferedSource.java:409)
  at y54.a (Unknown Source:2)
  at zt5.a (30)
  at com.google.firebase.messaging.FirebaseMessagingService.c (6)
  at du5.run (Unknown Source:7)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at qz0.run (Unknown Source:7)
  at java.lang.Thread.run (Thread.java:764)

(我也添加了模糊处理文件)

(I have added deobfuscation files too)

当我的意思是非常少的设备时,为了给您提供估计,今天通知已发送给大约9500个用户,崩溃发生在6个设备上.这不是一个大问题,但是考虑到过去7天我总共发生了21次崩溃,通知中有6次崩溃,这是非常糟糕的(对于DAU约为1K).

And when I mean very very few devices, to give you the estimate, today the notification was sent to ~9500 users, and the crash occurred on 6 devices. Not a major issue, but considering the fact that I have total 21 crashes in last 7 days, and 6 being the crashes from the notification, it's pretty bad (for ~1K DAU).

如果可以解决问题,我将在Play控制台中添加屏幕截图,以显示发生在哪些设备上:

I'll add the screenshot from Play Console to show on which devices it is occurring, if it helps to solve the issue:

另外,如果有帮助,从我的观察来看,这是在我将图像与通知(在发送通知之前可以上传图像的最新功能)一起附加的时候发生的.

Also, if it's of any help, from my observation this occurs when I attach an image along with notification (the latest feature where you can upload an image before sending notification).

那么我有什么可以避免这一问题的措施?还是Firebase方面的错误?

So is there anything I can do on my side to avoid this issue? Or is it a bug from firebase side?

推荐答案

因此,正如道格·史蒂文森(Doug Stevenson)告诉我与Firebase支持部门联系时,我做到了,并且我已获得有关此错误的更新.

So as Doug Stevenson told me to contact Firebase Support, I did and I have an update regarding this bug.

此处报告了此错误.

解决此问题的可能解决方法是减小通过通知发送的图像尺寸(尽管未确认).

The possible workaround for solving this issue is reducing the image size which is being sent via notification (not confirmed though).

如果您有任何更新/已经能够在本地产生此错误,则可以发送您在上述链接中拥有的信息,以便他们可以进行更多调查.

If you have any updates/have been able to produce this bug locally, you can send info that you have on the link mentioned above so that they can investigate more.

Osjack在那个问题上说,减小图像大小(以kb为单位),将宽度减小到200px,将高度按比例解决,对他来说就是一个问题.

Osjack on that issue said reducing the image size (making it in kb's), and also width to 200px and height proportionally solved the issue for him.

似乎他们已解决了Cloud Messaging SDK版本20.1.0中的问题.您可以在此处看到发行说明.因此,将库更新为20.1.0应该可以解决此问题.

Seems like they fixed the issue in version 20.1.0 of Cloud Messaging SDK. You can see the release notes here. So updating the library to 20.1.0 should solve the issue.

这篇关于使用Firebase发送推送通知后,仅在极少数设备上出现NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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