Fixed
Status Update
Comments
ti...@gmail.com <ti...@gmail.com> #2
Seems like it happens on API 21-22 too.
su...@google.com <su...@google.com>
su...@google.com <su...@google.com> #3
This is expected. You are calling: enqueueUniquePeriodicWork() with an ExistingPeriodicWorkPolicy.REPLACE. This will cancel running work, and kick off new instances of all Workers.
https://github.com/rubensousa/WorkManagerKitkatBug/blob/master/app/src/main/java/com/github/rubensousa/workkitkatbug/MainActivity.kt#L24
an...@gmail.com <an...@gmail.com> #4
I just ran the sample again and now the behaviour is different for some weird reason. I forgot to mention that I only used REPLACE to test this properly. Because it also happens with KEEP.
su...@google.com <su...@google.com> #5
And shouldn't the behaviour be consistent across all Android versions?
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: Android 4.X-6.0
We have a crasch in the WorkManager.
Is there a repository where we can download the code?
Fatal Exception: java.util.ConcurrentModificationException
java.util.ArrayList$ArrayListIterator.next (ArrayList.java:573)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.hasIntentWithAction (SourceFile:241)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.add (SourceFile:125)
androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$AddRunnable.run (SourceFile:289)
android.os.Handler.handleCallback (Handler.java:733)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5584)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1268)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1084)
dalvik.system.NativeStart.main (NativeStart.java)