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
@DevUnderos can you provide any more information to help debug? What action are you users performing when this happens? What version of the Firebase SDK are you using?
Hi all, I'm having same problem like this. I used firebase with version Firebase 10.2.1. Do you have solution for this case ? Thanks
OS Version: 6.0.1 RAM Free: 32% Disk Free: 58.2%
Fabric was report below: 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:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
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)
Exactly same here: com.google.android.gms.internal.zzblq.zzc, reported by Crashlytics, not reproducible in Lab. Only reported on ARM devices, but other factors: OS version, manufacturer - seem to be irrelevant.
This began as soon as we started to work with firebase, May 13, 2017. Our current version is 10.2.4. And number of crashes per day is not uniform:

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.
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
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.
@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
@alexcohn good catch, we have enabled remote config lately in the app. Let me have a quick test on something and I will come back to you.
This looks similar to me: https://stackoverflow.com/questions/42362024/firebase-remote-config-nullpointerexception-on-map-keyset
@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.
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.
Experiencing the same issues in our project. Random crashes with report like that:
Exception java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference com.google.android.gms.internal.zzblq.zzc () com.google.android.gms.internal.zzblq.zza () com.google.android.gms.internal.zzbtm.run () android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:231) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587) java.lang.Thread.run (Thread.java:818)
But for us this happens ONLY on Samsung devices, for some reason. Can't say after which Firebase update exactly this has started, but if I remove Firebase from the project completely - the issues disappears.
@jphw, have you checked https://github.com/firebase/quickstart-android/issues/291#issuecomment-312294335? Maybe all you need is set up the defaults, as described in step 2 ?
@alexcohn yes, we will add the defaults to our next release and hope that it will help (it does not reproduce on our devices so we will have to test it on our users).
@spirosoik Beware, this didn't fix it for me on all devices, it is still happening sometimes even with setDefaults();
@eXeP till now for us no errors at all.
I've been receiving these ever since 11.0.0 (on 11.0.4 now - android version 7.1.2):
08-15 23:58:05.974 16308-16435/com.myapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.myapp, PID: 16308
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.in.zzc(Unknown Source)
at com.google.android.gms.internal.in.zza(Unknown Source)
at com.google.android.gms.internal.abf.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:761)
Hi guys, we recently released an update for our app with remote config added back again. And we didn't get any crashes with it. I believe this issue has been solved with the latest library release for remote config.
I faced to same problem. (My app was applied firebaseVersion 11.0.2. at now) @ashtrisk said that this problem was fixed at latest version, (it may be 11.2.0 : https://firebase.google.com/support/release-notes/android) When I release next time, I will try to apply 11.2.0 version. Thank you for share.
I use firebase version 11.2.0 (core, crash, messaging, config) and I'm still having this problem:
Exception java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference com.google.android.gms.internal.zzebe.run (zzebe.java) android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:234) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588) java.lang.Thread.run (Thread.java:818)