question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConcurrentModificationException

See original GitHub issue

Environment

Environment: OS: macOS High Sierra 10.13.5 Node: 8.11.3 Yarn: 1.7.0 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed) react: 16.4.1 => 16.4.1 react-native: 0.55.4 => 0.55.4

Description

Caused by java.util.ConcurrentModificationException
       at android.support.v4.util.SimpleArrayMap.put(SimpleArrayMap.java:461)
       at android.support.v7.widget.AppCompatDrawableManager.addDelegate(AppCompatDrawableManager.java:493)
       at android.support.v7.widget.AppCompatDrawableManager.installDefaultInflateDelegates(AppCompatDrawableManager.java:97)
       at android.support.v7.widget.AppCompatDrawableManager.get(AppCompatDrawableManager.java:86)
       at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
       at android.support.v7.widget.TintTypedArray.getDrawable(TintTypedArray.java:75)
       at android.support.v7.widget.SwitchCompat.<init>(SwitchCompat.java:223)
       at android.support.v7.widget.SwitchCompat.<init>(SwitchCompat.java:200)
       at android.support.v7.widget.SwitchCompat.<init>(SwitchCompat.java:189)
       at com.facebook.react.views.switchview.ReactSwitch.<init>(ReactSwitch.java:23)
       at com.facebook.react.views.switchview.ReactSwitchManager.createViewInstance(ReactSwitchManager.java:118)
       at com.facebook.react.views.switchview.ReactSwitchManager.createViewInstance(ReactSwitchManager.java:31)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:42)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:223)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1012)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:983)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
       at android.view.Choreographer.doCallbacks(Choreographer.java:686)
       at android.view.Choreographer.doFrame(Choreographer.java:619)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7325)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Reproducible Demo

No idea how to reproduce as occurs randomly in release builds. The stack trace is from Crashlytics. Seems to be related on how React Native updates the UI. Our code does not have much control over the native screen updating and as JavaScript is single threaded, there isn’t much we can do about concurrency.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
tapzcommented, Aug 13, 2018

A nice way to get rid of bugs without fixing them. As nobody has mentioned a fix in the next RN version, it probably does not exist.

Testing with the new RN is not currently possible as it has compatibility issues with my dependencies (or for some other reason does not work at all).

2reactions
arledcommented, Mar 26, 2019

Getting this on android only:

    "react": "16.4.1",
    "react-native": "0.56.0",

All bugs related to this end up getting closed with no without a solution!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConcurrentModificationException (Java Platform SE 7 )
This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.
Read more >
Avoiding the ConcurrentModificationException in Java
A short insight in Java's ConcurrentModificationException, why it happens and how to avoid it.
Read more >
How to Avoid the Concurrent Modification Exception in Java
The ConcurrentModificationException is a very common exception in Java that occurs usually while working with Collections.
Read more >
How to avoid "ConcurrentModificationException" while ...
Of course, I get a ConcurrentModificationException when trying to remove items from the list at the same time when iterating myArrayList .
Read more >
java.util.ConcurrentModificationException - DigitalOcean
java.util.ConcurrentModificationException is a very common exception when working with Java collection classes. Java Collection classes are fail ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found