Fixed
Status Update
Comments
ra...@google.com <ra...@google.com>
ot...@gmail.com <ot...@gmail.com> #2
Have same problem
ot...@gmail.com <ot...@gmail.com> #3
java.util.ConcurrentModificationException
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.work.impl.utils.WakeLocks.checkWakeLocks(WakeLocks.java:70)
at androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted(SystemAlarmService.java:69)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion(SystemAlarmDispatcher.java:217)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run(SystemAlarmDispatcher.java:317)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4960)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(NativeStart.java)
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.work.impl.utils.WakeLocks.checkWakeLocks(WakeLocks.java:70)
at androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted(SystemAlarmService.java:69)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion(SystemAlarmDispatcher.java:217)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run(SystemAlarmDispatcher.java:317)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4960)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(NativeStart.java)
ru...@gmail.com <ru...@gmail.com> #5
Will this be released in the next beta? Thanks
ra...@google.com <ra...@google.com> #6
Yes, it will.
ru...@gmail.com <ru...@gmail.com> #7
Seems like it's still not fixed:
Fatal Exception: java.util.ConcurrentModificationException
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.work.impl.utils.WakeLocks.checkWakeLocks(WakeLocks.java:78)
at androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted(SystemAlarmService.java:69)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion(SystemAlarmDispatcher.java:217)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run(SystemAlarmDispatcher.java:317)
at android.os.Handler.handleCallback(Handler.java:810)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5532)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
Fatal Exception: java.util.ConcurrentModificationException
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.work.impl.utils.WakeLocks.checkWakeLocks(WakeLocks.java:78)
at androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted(SystemAlarmService.java:69)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion(SystemAlarmDispatcher.java:217)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run(SystemAlarmDispatcher.java:317)
at android.os.Handler.handleCallback(Handler.java:810)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5532)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
ru...@gmail.com <ru...@gmail.com> #8
Still happened on beta02, Android 5.0.2
ru...@gmail.com <ru...@gmail.com> #9
Sample app here: https://issuetracker.google.com/issues/121345393
It's hard to reproduce with SystemAlarmService.onAllCommandsCompleted. Only managed to do it once but it was just luck. The sample app crashes more often though.
It's hard to reproduce with SystemAlarmService.onAllCommandsCompleted. Only managed to do it once but it was just luck. The sample app crashes more often though.
ra...@google.com <ra...@google.com> #11
Thanks for the bug report and the sample app. Will take another look.
su...@google.com <su...@google.com> #12
Why are you calling a hidden method (WakeLocks#checkWakeLocks) yourself?
ru...@gmail.com <ru...@gmail.com> #13
Just to reproduce the crash faster. I don't call this on the production app.
su...@google.com <su...@google.com>
ru...@gmail.com <ru...@gmail.com> #15
Thanks a lot for fixing it quickly ;)
md...@gmail.com <md...@gmail.com> #16
It still seems to happen for me using beta02:
java.util.WeakHashMap$HashIterator.next (WeakHashMap.java:165)
androidx.work.impl.utils.WakeLocks.checkWakeLocks (WakeLocks.java:78)
androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted (SystemAlarmService.java:69)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion (SystemAlarmDispatcher.java:217)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run (SystemAlarmDispatcher.java:317)
android.os.Handler.handleCallback (Handler.java:815)
android.os.Handler.dispatchMessage (Handler.java:104)
android.os.Looper.loop (Looper.java:194)
android.app.ActivityThread.main (ActivityThread.java:5624)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:959)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:754)
Stacktrace is from a X5pro running Android 5.1.
java.util.WeakHashMap$HashIterator.next (WeakHashMap.java:165)
androidx.work.impl.utils.WakeLocks.checkWakeLocks (WakeLocks.java:78)
androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted (SystemAlarmService.java:69)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion (SystemAlarmDispatcher.java:217)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run (SystemAlarmDispatcher.java:317)
android.os.Handler.handleCallback (Handler.java:815)
android.os.Handler.dispatchMessage (Handler.java:104)
android.os.Looper.loop (Looper.java:194)
android.app.ActivityThread.main (ActivityThread.java:5624)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:959)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:754)
Stacktrace is from a X5pro running Android 5.1.
ra...@google.com <ra...@google.com> #17
Another fix will be available in beta03.
Description
Version used: alpha13
Devices/Android versions reproduced on: 5.1.1
Got this crash through crashlytics. App wasn't in background
Fatal Exception: java.util.ConcurrentModificationException
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.work.impl.utils.WakeLocks.checkWakeLocks(WakeLocks.java:70)
at androidx.work.impl.background.systemalarm.SystemAlarmService.onAllCommandsCompleted(SystemAlarmService.java:69)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.dequeueAndCheckForCompletion(SystemAlarmDispatcher.java:215)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$DequeueAndCheckForCompletion.run(SystemAlarmDispatcher.java:315)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5675)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)