Android crash: This dynamic value has been recycled
See original GitHub issueI’m seeing this crash log on Android in production since updating to ^7.0.0. I’m not sure how to reproduce locally but it comes a svg component that is animated using native animated. However I can’t reproduce the crash reliably so there must be some kind of race condition, it happens rather rarely, ~20 instances in the past week for a few thousand users.
I noticed the implementation uses shadow nodes to save the svg data but if I understand correctly it could just be normal uithread view manager props. Shadow nodes run on a different thread so it might be what causes this race condition.
Here’s the full stacktrace if that can be useful, the interesting part is the inner exception.
JSApplicationIllegalArgumentException
Error while updating property 'stroke' of a view managed by: RNSVGRect
com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter in updateViewProp at line 95
com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter in setProperty at line 132
com.facebook.react.uimanager.ViewManagerPropertyUpdater in updateProps at line 51
com.facebook.react.uimanager.ViewManager in updateProperties at line 34
com.facebook.react.uimanager.NativeViewHierarchyManager in createView at line 269
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation in execute at line 200
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in dispatchPendingNonBatchedOperations at line 1105
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in doFrameGuarded at line 1076
com.facebook.react.uimanager.GuardedFrameCallback in doFrame at line 29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher in doFrame at line 134
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1 in doFrame at line 105
android.view.Choreographer$CallbackRecord in run at line 869
android.view.Choreographer in doCallbacks at line 683
android.view.Choreographer in doFrame at line 616
android.view.Choreographer$FrameDisplayEventReceiver in run at line 857
android.os.Handler in handleCallback at line 751
android.os.Handler in dispatchMessage at line 95
android.os.Looper in loop at line 154
android.app.ActivityThread in main at line 6154
java.lang.reflect.Method in invoke
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 867
com.android.internal.os.ZygoteInit in main at line 757
InvocationTargetException
java.lang.reflect.Method in invoke
com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter in updateViewProp at line 83
com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter in setProperty at line 132
com.facebook.react.uimanager.ViewManagerPropertyUpdater in updateProps at line 51
com.facebook.react.uimanager.ViewManager in updateProperties at line 34
com.facebook.react.uimanager.NativeViewHierarchyManager in createView at line 269
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation in execute at line 200
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in dispatchPendingNonBatchedOperations at line 1105
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in doFrameGuarded at line 1076
com.facebook.react.uimanager.GuardedFrameCallback in doFrame at line 29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher in doFrame at line 134
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1 in doFrame at line 105
android.view.Choreographer$CallbackRecord in run at line 869
android.view.Choreographer in doCallbacks at line 683
android.view.Choreographer in doFrame at line 616
android.view.Choreographer$FrameDisplayEventReceiver in run at line 857
android.os.Handler in handleCallback at line 751
android.os.Handler in dispatchMessage at line 95
android.os.Looper in loop at line 154
android.app.ActivityThread in main at line 6154
java.lang.reflect.Method in invoke
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 867
com.android.internal.os.ZygoteInit in main at line 757
IllegalStateException
This dynamic value has been recycled
com.facebook.react.bridge.DynamicFromMap in asString at line 78
com.horcrux.svg.RenderableShadowNode in setStroke at line 139
com.horcrux.svg.RenderableViewManager in setStroke at line 723
java.lang.reflect.Method in invoke
com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter in updateViewProp at line 83
com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter in setProperty at line 132
com.facebook.react.uimanager.ViewManagerPropertyUpdater in updateProps at line 51
com.facebook.react.uimanager.ViewManager in updateProperties at line 34
com.facebook.react.uimanager.NativeViewHierarchyManager in createView at line 269
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation in execute at line 200
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in dispatchPendingNonBatchedOperations at line 1105
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in doFrameGuarded at line 1076
com.facebook.react.uimanager.GuardedFrameCallback in doFrame at line 29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher in doFrame at line 134
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1 in doFrame at line 105
android.view.Choreographer$CallbackRecord in run at line 869
android.view.Choreographer in doCallbacks at line 683
android.view.Choreographer in doFrame at line 616
android.view.Choreographer$FrameDisplayEventReceiver in run at line 857
android.os.Handler in handleCallback at line 751
android.os.Handler in dispatchMessage at line 95
android.os.Looper in loop at line 154
android.app.ActivityThread in main at line 6154
java.lang.reflect.Method in invoke
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 867
com.android.internal.os.ZygoteInit in main at line 757
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:56 (14 by maintainers)
Top Results From Across the Web
Android crash: This dynamic value has been recycled #806
I'm seeing this crash log on Android in production since updating to ^7.0.0. I'm not sure how to reproduce locally but it comes...
Read more >RecyclerView crashes when "scrapped or attached views may ...
This error is caused if in your XML you have android:animateLayoutChanges set to true and you call notifyDataSetChanged() on the RecyclerView's adapter in ......
Read more >Slow rendering - Android Developers
ListView and especially RecyclerView are commonly used for complex scrolling lists that are most susceptible to jank. They both contain Systrace markers, so...
Read more >IndexOutOfBoundsException in RecyclerView ... - Issue Tracker
It's also possible that placing dynamic recycler view on a not visible ... After the list had been refreshed, the crash appeared when...
Read more >Managing Bitmap Memory | Android Developers
The bitmap is not null , and it hasn't been recycled yet. ... If a suitable bitmap has been found, set it as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@msand Awesome, thanks! I just tested master and everything works fine.
Good news, the fix will make it in the next rn minor https://github.com/react-native-community/react-native-releases/issues/48#issuecomment-431416538