New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in FirebaseMessagingService #16

Closed
thedumbtechguy opened this Issue May 23, 2016 · 58 comments

Comments

Projects
None yet
@thedumbtechguy

thedumbtechguy commented May 23, 2016

I got this crash today. First day in production.
The crash report is from Crashalytics.

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzT(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)

@thedumbtechguy thedumbtechguy changed the title NullpointerException NullPointerException in FirebaseMessagingService May 23, 2016

@ianbarber

This comment has been minimized.

Member

ianbarber commented May 23, 2016

This may be due to a device having an old version of Google Play services, but that's not a great error regardless. Are you seeing a high volume?

@thedumbtechguy

This comment has been minimized.

thedumbtechguy commented May 23, 2016

Just one crash from one user.
I'm not closing the app when play services is not available so that could
be it.

Thanks.
On May 23, 2016 6:11 PM, "Ian Barber" notifications@github.com wrote:

This may be due to a device having an old version of Google Play services,
but that's not a great error regardless. Are you seeing a high volume?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#16 (comment)

@kroikie

This comment has been minimized.

Contributor

kroikie commented May 23, 2016

While checking for Google Play services would be good, I think this case is a result of the device in question not having the correct version of Google Play services. I have notified the team and they are looking into it.

@kroikie kroikie closed this May 23, 2016

@andytriboletti

This comment has been minimized.

andytriboletti commented May 29, 2016

I also got this crash report from Crashlytics:

Fatal Exception: java.lang.NullPointerException
at com.google.firebase.messaging.FirebaseMessagingService.zzT(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)

Device: GI-I9500_TMMARS
OS: 4.1.1
ROOTED: Yes

I'm not checking for Google Play Services.

@sibelius

This comment has been minimized.

sibelius commented Jun 1, 2016

@kroikie I'm receiving the same error here, and I have not added anything of Firebase on my code.
I've updated to com.google.android.gms:play-services:9.0.1 that includes it (https://developers.google.com/android/guides/releases#may_2016_-_v90)

But what happens if I don't wanna use Firebase yet?

@kroikie

This comment has been minimized.

Contributor

kroikie commented Jun 1, 2016

@andytriboletti what version of Google Play Services is the device running?

@sibeliusseraphini Firebase Analytics is added by the google-services plugin which should work without issue, but if you want your app to be Firebase free then you can remove the google-services plugin and manually add the required Strings to your strings.xml file.

@andytriboletti

This comment has been minimized.

andytriboletti commented Jun 2, 2016

How do I find out what version of Google Play Services lib the device is running? Does Firebase log that? If Firebase needs latest version of play services, why not prompt user directly instead of having developer needing to do it resulting in crash if not implemented?

@samtstern

This comment has been minimized.

Member

samtstern commented Jun 7, 2016

@andytriboletti in many cases the SDK does prompt the user to update when they will likely be able to.

You can check your version by going to Settings > Apps > Google Play Services

@andytriboletti

This comment has been minimized.

andytriboletti commented Jun 7, 2016

I have the latest version on my phone I think, anyway, it's not crashing on my phone. This is from a crash report that a user is experiencing that I saw via Fabric.

@samtstern

This comment has been minimized.

Member

samtstern commented Jun 8, 2016

@sibelius is this happening on your device or a user's device? If possible, could you provide logs?

@samtstern

This comment has been minimized.

Member

samtstern commented Jun 8, 2016

@andytriboletti I have the proguard mapping so I can find out where that NPE is happening, I will report to the FCM team.

@sibelius

This comment has been minimized.

sibelius commented Jun 9, 2016

this is the logs, the same as the above, this happened in my device running android 4.4

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzT(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)
@samtstern

This comment has been minimized.

Member

samtstern commented Jun 9, 2016

@sibelius @andytriboletti ok I have an update here. The SDK team knows about this issue and has a fix in place (it's a simple null check, of course). I can't guarantee exactly when this fix will be integrated into the publicly released SDK, unfortunately.

As that's all we can do here I am going to close this issue. Thank you everyone for your feedback and help identifying this.

@sensen

This comment has been minimized.

sensen commented Jun 23, 2016

@samtstern does this affect version 9.0.0?

@Miindaugas

This comment has been minimized.

Miindaugas commented Aug 12, 2016

Got this issue to with older Android versions. 4.1 - 4.4. Crash logs stacking.

@rishi023

This comment has been minimized.

rishi023 commented Aug 16, 2016

following logs for device (GI-I9500_TMMARS) running android 4.1.1

Fatal Exception: java.lang.NullPointerException

   at com.google.firebase.messaging.FirebaseMessagingService.zzT(Unknown Source)
   at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
   at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
   at com.google.firebase.iid.zzb$2.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
   at java.lang.Thread.run(Thread.java:856)
@samtstern

This comment has been minimized.

Member

samtstern commented Aug 16, 2016

@Miindaugas @rishi023 what version of the Firebase SDK are you using in your app? This should be fixed in the 9.4.0 versions.

@FabianBravoA

This comment has been minimized.

FabianBravoA commented Aug 16, 2016

Almost the same here :
Firebase (play-services) : 9.2.1

at com.google.firebase.messaging.FirebaseMessagingService.zzav(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)

@samtstern

This comment has been minimized.

Member

samtstern commented Aug 16, 2016

@FabianBravoA this was fixed in 9.4.0, could you try updating your dependencies and reporting back if this error still occurs? Remember to update all com.google.android.gms and com.google.firebase dependencies to the same version.

@FabianBravoA

This comment has been minimized.

FabianBravoA commented Aug 16, 2016

@samtstern Will do, thanks for the quick reply!

@sydneyitguy

This comment has been minimized.

sydneyitguy commented Aug 25, 2016

I'm having the same crash on 9.4.0.
Stack trace is exactly the same.

Not too frequent, but about 1% of users.
Reported environment: GI-I9500_TMMARS / Android 4.1.1 environment

@jgiambona

This comment has been minimized.

jgiambona commented Sep 2, 2016

Having the exact same issue on 9.4.0 a few hours after going to production

@chkfung

This comment has been minimized.

chkfung commented Sep 6, 2016

Crashing on firebase 9.4.0
Fabric reported device : GI-I9500_TMMARS 4.1.1

@darwin2k

This comment has been minimized.

darwin2k commented Sep 8, 2016

same her:
crashing with Firebase 9.4.0. 1 day in production. For me it seems strange that everbody has the exactly the same device in their crashreport: GI-I9500_TMMARS 4.1.1 and rooted. I am quiet sure that no one tried my app with a rooted phone because it did not promote the app in any way...

@justincpollard

This comment has been minimized.

justincpollard commented Sep 13, 2016

Another similar crash:

Device: Batmobile XT320
Android v4.3.1
Rooted
Firebase 9.4.0

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
       at java.lang.Thread.run(Thread.java:841)
@rpattabi

This comment has been minimized.

rpattabi commented Sep 18, 2016

This issue must be reopened. The problem still exists in 9.4.0

@BradThome

This comment has been minimized.

BradThome commented Sep 20, 2016

@samtstern I see the error on 9.4.0 as well, although it only happens on device model XT320 and api 4.3.1 (wondering if that's the automated testing device that google uses when submitting an app for production?).

@samtstern

This comment has been minimized.

Member

samtstern commented Oct 7, 2016

@kristiyanP that StackOverflow report describes a very strange execution environment (a cloud-based security checker for Android). Are you seeing this bug with 9.6.1 on physical devices?

@tasomaniac those devices are seeing the crash even with SDK 9.6.1? If so, do you have these devices or are they customer devices you're seeing via crash reporting software.

@tasomaniac

This comment has been minimized.

tasomaniac commented Oct 7, 2016

@samtstern we just went from Play Services 8.x to 9.6.1 and integrated FCM. It's happening on 9.6.1. They all are coming from Crashlytics.

@samtstern

This comment has been minimized.

Member

samtstern commented Oct 7, 2016

@tasomaniac could you provide a stack trace from Crashlytics? Any info would help.

@kristiyanP

This comment has been minimized.

kristiyanP commented Oct 10, 2016

@samtstern no we haven't experienced this bug on any of our test devices. We saw it from the Crashlytics log

#Date: 2016-10-09T21:13:48Z
#OS Version: 4.1.1
#Device: GI-I9500_TMMARS
#RAM Free: 78.9%
#Disk Free: 97.5%

#0. Crashed: pool-8-thread-1: 0 0 0x0000000000000000
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)

--

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)

#0. Crashed: pool-8-thread-1: 0 0 0x0000000000000000
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)
@samtstern

This comment has been minimized.

Member

samtstern commented Oct 10, 2016

@kristiyanP that's from a GI-I9500_TMMARS device which previous comments have suggested we can ignore, since it's from a Trend Micro cloud service that is known to crash in strange ways.

@mrjjwilson

This comment has been minimized.

mrjjwilson commented Oct 12, 2016

I am also having the same issue with a device named "Batmobile XT320" for only one user on a Rooted device. The crash has only appeared when going live and is showing up in Fabric Crashlytics.

Partial Stack trace:

OS Version: 4.3.1
Device: XT320
RAM Free: 79.4%
Disk Free: 69%

Fatal Exception: java.lang.NullPointerException
at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)

Looking at previous comments in this thread, I am assuming "Batmobile XT320" is also some sort of Bot / cloud service.

The app is using version 9.4 of play services.

I do not have an error from a "GI-I9500_TMMARS" device, only "XT320".

If anyone has worked out what Bot this may be, let us know.

I am ignoring this crash for now.

Thanks!
Jerry

@tasomaniac

This comment has been minimized.

tasomaniac commented Oct 12, 2016

Here is the stacktrace that we have: http://crashes.to/s/3c3ee631725

We also have the same devices. ie. GI-I9500_TMMARS and Batmobile. I'm not sure but I am suspecting that these devices can be the ones in Firebase Test Lab that are used for Noto tests when we upload APKs to Play Store.

org.gdg.frisbee.android_issue_305_crash_57f77893024d00010898d55c04266948.txt

@samtstern

This comment has been minimized.

Member

samtstern commented Oct 12, 2016

@tasomaniac thanks for the crash link! That should be very helpful.

@mobiRic

This comment has been minimized.

mobiRic commented Dec 7, 2016

I haven't seen reference to Firebase 9.8.0 yet, so here is the stack trace from the (previously mentioned) Batmobile XT320 (Android 4.3.1 rooted):

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
       at java.lang.Thread.run(Thread.java:841)
@PoulsQ

This comment has been minimized.

PoulsQ commented Jan 18, 2017

Hi guys,
I'm having the same issue time to time.
Here is the full log of one that happen yesterday :
https://gist.github.com/PoulsQ/5549903b0012f4127fd43f1a9011776e

@sohamtriveous

This comment has been minimized.

sohamtriveous commented Jan 19, 2017

Noticing the same issue on a rooted Batmobile XT320 (Firebase 10.0.1), happy to help with logs.

@pedrofsn

This comment has been minimized.

pedrofsn commented Jan 21, 2017

GI-I9500_TMMARS
4.1.1
Rooted

Fatal Exception: java.lang.NullPointerException
at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)

@samtstern

This comment has been minimized.

Member

samtstern commented Jan 23, 2017

@pedrofsn @triveous as mentioned in previous comments we believe that the TMMARS and Batmobile devices are not real users but some sort of automated testing device/emulator bank and therefore they do not behave correctly. The current suggestion is to ignore those users.

@nishantt95

This comment has been minimized.

nishantt95 commented Jan 25, 2017

Yes, I am getting the same error and reason being that these users/devices are bots. On analyzing this particular error on Crashlytics and Appsee combined I figured out that as soon as I upload new apk on play store I get 2-3 crash registered on Crashlytics and theses users (possibly bots) are from Mountain View California [source: Appsee] (well I guess it's Google's location).

@tasneembohra

This comment has been minimized.

tasneembohra commented Mar 3, 2017

I am still facing this issue in 10.0.1 . For the same device GI-I9500_TMMARS 4.1.1 and for Batmobile

@suhadzain

This comment has been minimized.

suhadzain commented Mar 28, 2017

Update both google and firebase api. problem will fix

@sibelius

This comment has been minimized.

sibelius commented May 17, 2017

I'm only using this plugin https://developers.google.com/android/guides/google-services-plugin

And I still have the error, I'm not using firebase package

how do I solve this?

@mfaragallah

This comment has been minimized.

mfaragallah commented Jun 4, 2017

I am facing the same issue using:
compile 'com.google.firebase:firebase-messaging:10.0.1'

Kindly advise.

@justincpollard

This comment has been minimized.

justincpollard commented Jun 5, 2017

Could try updating to the latest version of Firebase: 10.2.6

@mfaragallah

This comment has been minimized.

mfaragallah commented Jun 7, 2017

Hi Justin, It worked with 10.2.6 . Thank you.

@andj207

This comment has been minimized.

andj207 commented Jul 9, 2018

I'm facing this issue using:
implementation 'com.google.firebase:firebase-core:16.0.1'

1 user 4 reports (Huawei P8 lite 2017 (HWPRA-H), Android 7.0):

java.lang.NoSuchMethodError: 
 
  at com.google.firebase.messaging.FirebaseMessagingService.zzb (Unknown Source)
 
  at com.google.firebase.iid.zzb.onStartCommand (Unknown Source)
 
  at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:3476)
 
  at android.app.ActivityThread.-wrap23 (ActivityThread.java)
 
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1674)
 
  at android.os.Handler.dispatchMessage (Handler.java:105)
 
  at android.os.Looper.loop (Looper.java:156)
 
  at android.app.ActivityThread.main (ActivityThread.java:6523)
 
  at java.lang.reflect.Method.invoke (Native Method)
 
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:942)
 
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832)

Kindly advise.

@kroikie

This comment has been minimized.

Contributor

kroikie commented Jul 9, 2018

@andj207 could be an issue with the versions of firebase-iid and firebase-messaging you are using. I would advise using the latest versions of the SDKs.

@andj207

This comment has been minimized.

andj207 commented Jul 9, 2018

@kroikie I'm using the latest one

    implementation 'com.google.firebase:firebase-core:16.0.1'
@kroikie

This comment has been minimized.

Contributor

kroikie commented Jul 9, 2018

@andj207 are you using the latest versions of the other SDKs as well?

@andj207

This comment has been minimized.

andj207 commented Jul 9, 2018

@kroikie yes, the Gradle doesn't suggest any new update for any libs. But, I notice the Play service for ads is lower implementation 'com.google.android.gms:play-services-ads:15.0.1' . Will it be the problem?

@kroikie

This comment has been minimized.

Contributor

kroikie commented Jul 9, 2018

@andj207 I don't think the ads SDK is the issue here. com.google.firebase.messaging.FirebaseMessagingService.zzb (Unknown Source) usually suggests that the device is running an old version of Google Play Services. I'd try updating the Play Services on the device and that should resolve the issue.

@andj207

This comment has been minimized.

andj207 commented Jul 9, 2018

@kroikie The problem is it crashes on "user" device, the report I got from Android Vitals in Play Console. I guess the user is from China so Play Service is not available. I need to use Admob, Firebase analytics for my app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment