Firebase Crash Library - NullPointerException in t

2019-02-06 01:51发布

问题:

I've implemented the new Firebase Crash library (https://github.com/firebase/quickstart-android/tree/master/crash) to log error in Android app.

Anyone is having similar problem.

I'm checking errors and on the top I've got:

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes()' on a null object reference
android.util.Base64.decode (Base64.java:118)
com.google.firebase.iid.zzg.zzeH (zzg.java:)
com.google.firebase.iid.zzg.zzeE (zzg.java:)
com.google.firebase.iid.zzd.zzCd (zzd.java:)
com.google.firebase.iid.zzd.zzc (zzd.java:)
com.google.firebase.iid.zzd.getToken (zzd.java:)
com.google.firebase.iid.FirebaseInstanceId.getToken (FirebaseInstanceId.java:)
com.google.firebase.iid.FirebaseInstanceId.zzUo (FirebaseInstanceId.java:)
com.google.firebase.iid.FirebaseInstanceIdService.zza (FirebaseInstanceIdService.java:)
com.google.firebase.iid.FirebaseInstanceIdService.zzm (FirebaseInstanceIdService.java:)
com.google.firebase.iid.zzb$2.run (zzb.java:)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
java.lang.Thread.run (Thread.java:818)

I have checked but there are not extra proguard rules for Firebase Crash. Is it bug in the library? Anyone is having similar problem?

I can't reproduce error on my devices.

The error is strange and I don't know in which place in the application. Nothing so I think it's connected to Crash library.

This is not standard nullexception. It's connected to Firebase Crash library. Why I'm thinking this is library bug - there is no sign on my code/activity here.

回答1:

It was confirmed by Google that this was bug in the InstanceID library.

All you can do right now is to update to the latest version and hope this will be fixed.

compile 'com.google.firebase:firebase-crash:9.4.0'

Note #1

You can see in the comments that some people are still getting this error. At the moment we can't do nothing more than update to the latest version. If you've been using previous version - update to the latest. We need info from Firebase team about it.

Note #2 This seems to be fixed in 9.4.0 but we still need confirmation



回答2:

Seems to be fixed in

compile 'com.google.firebase:firebase-crash:9.4.0'


回答3:

This is a bug in the InstanceID library in 9.0, sorry. We've identified a fix and will include it in a future SDK release.

We believe it should be fairly rare, but please comment if you're seeing a large number of devices.



回答4:

There is a new version of Google Play Services available: 9.2.1. Apparently it has the fix inside. I'll confirm it once I have enough data.