Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] ConcurrentModificationException #40

Open
williamleungapptask opened this issue Aug 11, 2022 · 4 comments
Open

[Android] ConcurrentModificationException #40

williamleungapptask opened this issue Aug 11, 2022 · 4 comments

Comments

@williamleungapptask
Copy link

This issue still happens with the 0.10.2 release.
"react-native": "0.63.4",
"@stream-io/flat-list-mvcp": "^0.10.2",

java.util.ConcurrentModificationException: null
    at java.util.ArrayList$Itr.next(ArrayList.java:860)
    at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:795)
    at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:119)
    at com.facebook.react.bridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete(CatalystInstanceImpl.java:171)
    at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:920)
@aweffr
Copy link

aweffr commented Sep 9, 2022

same here
we have this ConcurrentModificationException too
the stacktrace is same:

java.util.ConcurrentModificationException: null
    at java.util.ArrayList$Itr.next(ArrayList.java:860)
    at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:799)
    at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:119)
    at com.facebook.react.bridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete(CatalystInstanceImpl.java:172)
    at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:236)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

@utsavo-afk
Copy link

Same issue here, however we are seeing ReanimatedUIManager.java in the stack trace
Any suggestions on fixes?
Fatal Exception: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next(ArrayList.java:860) at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:35) at com.facebook.react.uimanager.ReanimatedUIManager.onBatchComplete(ReanimatedUIManager.java) at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:24) at com.facebook.react.bridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete(CatalystInstanceImpl.java:14) at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:37) at java.lang.Thread.run(Thread.java:920)

@ponikar
Copy link

ponikar commented Sep 27, 2022

any updates on this issue?

@larkox
Copy link

larkox commented Jun 23, 2023

Looking into the code, it seems part of the problem is that in onBatchComplete on the UIManagerModule.java in React Native, the code iterates over the UIManageModuleListener doing its own stuff. And for some reason, when that is happening, removeUIManagerListener is being called (a listener gets removed while the iterator is executing).

This function is called by in

Funny enough, I don't see any other dependency in our project that uses this function, so not sure if this is a problem with this project, or with React Native handling of these listeners.

Hope this helps to find out the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants