quickstart-android: NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference at com.google.android.gms.internal.zzblq.zzc(Unknown Source)

After using firebase (Analytics, Cloud Messaging, Remote Config) libraries i’m having this problem on different os versions of android.

Issue details from Fabric.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
       at com.google.android.gms.internal.zzblq.zzc(Unknown Source)
       at com.google.android.gms.internal.zzblq.zza(Unknown Source)
       at com.google.android.gms.internal.zzbtm.run(Unknown Source)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

Firebase v10.2.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 21
  • Comments: 65 (9 by maintainers)

Most upvoted comments

Hi all

This should finally be fixed in SDK version 15.0.0. For everyone who was affected by this bug for so long: we apologize and will do better. We had a number of internal mishaps that resulted in this bugfix taking forever to be deployed. We have already circulated a postmortem internally to make sure we don’t do this again.

Thank you to everyone who added their thoughts here.

@Guys it’s serious problem it happens more and more in the production app! Around a huge number of crashes for each user.

For us started after upgrading to google play services + firebase 11.0.0

same error here for Android 7.0 we have seen this.

ko (Deobfuscated class name) com.google.android.gms.internal.ko.zzaQ
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
       at com.google.android.gms.internal.ko.zzaQ(Unknown Source)
       at com.google.android.gms.internal.ko.zzaQ(Unknown Source)
       at com.google.android.gms.internal.afv.run(Unknown Source)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

@alexcohn it seems that this issue occurs when you are using RemoteConfig and you haven’t anything set it up as config parameters. If you add some parameters this will never crash again. (at least till now no errors)

But this should be fixed in any case.

It is one big joke from the firebase team. One year later and the problem (big problem!) still exists. I’m glad I removed RemoteConfig a few months ago.

The classes of com.google.android.gms.internal are obfuscated, but from what I can derive, a null List can result from unsuccessful call (via invoke()) to AppMeasurement.class.getDeclaredMethod("getConditionalUserProperties"), in static List<Object> zzblq.zzb(AppMeasurement var0, String var1), in firebase-config-10.2.4.

The only public trigger for this seems to be Task<Void> fetch(long var1) in FirebaseRemoteConfig class.

I think we can really ignore the root cause - why some object is null at this point, as long as the app can not verify that the SDK is prepared to call fetch(). The problem here is that the crash happens in an async call, and there seems to be no clean way to catch an unhandled exception there.

One simple fix would be to simply add NullPointerException to the list of catch in zzblq.class:189, which today is

} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException var4) {
  Log.e("FirebaseAbtUtil", "Could not complete the operation due to an internal error.", var4);
}

make it

} catch (NullPointerException | IllegalAccessException | InvocationTargetException | NoSuchMethodException var4) {
  Log.e("FirebaseAbtUtil", "Could not complete the operation due to an internal error.", var4);
  var2 = new ArrayList();
}

… and the end-user will at least have a chance to recover.

And with 15.0.0 there is another one introduced:

Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'void com.google.android.gms.internal.config.zzar.zzc(long)' on a null object reference
com.google.firebase.remoteconfig.FirebaseRemoteConfig. (Unknown Source)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)

never ending story

Should I create new issue here?

Hi guys,

I’m facing the same problem since I’ve implemented Remote Config. But, i’ve got a little different stacktrace :

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
       at android.os.Parcel.readException(Parcel.java:1626)
       at android.os.Parcel.readException(Parcel.java:1573)
       at com.google.android.gms.internal.zzeu.zzb(Unknown Source)
       at com.google.android.gms.internal.zzbik.zza(Unknown Source)
       at com.google.android.gms.internal.zzbhr.zza(Unknown Source)
       at com.google.android.gms.internal.zzbht.zza(Unknown Source)
       at com.google.android.gms.common.api.internal.zzm.zzb(Unknown Source)
       at com.google.android.gms.common.api.internal.zzc.zza(Unknown Source)
       at com.google.android.gms.common.api.internal.zzbo.zzh(Unknown Source)
       at com.google.android.gms.common.api.internal.zzbo.zzaiw(Unknown Source)
       at com.google.android.gms.common.api.internal.zzbo.onConnected(Unknown Source)
       at com.google.android.gms.common.internal.zzac.onConnected(Unknown Source)
       at com.google.android.gms.common.internal.zzn.zzj(Unknown Source)
       at com.google.android.gms.common.internal.zze.zzakr(Unknown Source)
       at com.google.android.gms.common.internal.zzi.zzaks(Unknown Source)
       at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.os.HandlerThread.run(HandlerThread.java:61)

Using the last firebase version or using a map for defaults values instead of an xml changed nothing.

@eXeP till now for us no errors at all.

Same crash with:

  • Firebase: 11.4.2
  • targetSdk: 27
  • compileSdk: 27
  • buildTools: 27.0.3

Any update on this? I keep getting crash reports and I am going to need to remove Remote Config from the app unless there is an update soon. Do you have a schedule at least?

NullPointerException we are talking about here is connected with with Remote Config. I implemented my own config functionality and abandoned provided by Firebase and the problem stopped appearing.

We have had a similar issue see here - https://stackoverflow.com/questions/42362024/firebase-remote-config-nullpointerexception-on-map-keyset . We were having crashes for a lot of users in released build as reported by Crashlytics. We reported it as bug to firebase and with a series of mail lasted about 15 - 20 days, firebase team accepted it is a bug in their remote config library. And we eventually have to remove Firebase remote config from our App. This happened with us about 4 months ago. They said they will fix this in the next release. We will be making another release with Remote config re-integrated. Will update if similar issue occurs with us again.

Just to add more info it seems that it happens on application open. Also it happens at least for us for OS Version: 6.0.1 and 7.0.