react-native-reanimated
react-native-reanimated copied to clipboard
[Android] 2.8.0 - The specified child already has a parent
Description
I found this logged on Sentry and it seems to mention a Reanimated stack trace.
Android 10, OnePlus model GM1925 (QKQ1.190716.003)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:5131)
at android.view.ViewGroup.addView(ViewGroup.java:4960)
at com.facebook.react.views.view.ReactViewGroup.addView(ReactViewGroup.java:466)
at android.view.ViewGroup.addView(ViewGroup.java:4900)
at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:38)
at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:19)
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:533)
at com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren(ReanimatedNativeHierarchyManager.java:306)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:217)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:915)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1026)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1086)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1161)
at android.view.Choreographer.doCallbacks(Choreographer.java:986)
at android.view.Choreographer.doFrame(Choreographer.java:894)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1148)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7682)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Expected behavior
No crash.
Actual behavior & steps to reproduce
Native crash, not sure what the circumstances are. Just found it in Sentry.
Snack or minimal code example
Unknown.
Package versions
name | version |
---|---|
react-native | 0.68.1 |
react-native-reanimated | 2.8.0 |
Affected platforms
- [x] Android
- [ ] iOS
- [ ] Web
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?
Have similar issue, only stacktrace
Fatal Exception: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:5247)
at android.view.ViewGroup.addView(ViewGroup.java:5076)
at com.facebook.react.views.view.ReactViewGroup.addView(ReactViewGroup.java:465)
at android.view.ViewGroup.addView(ViewGroup.java:5016)
at com.facebook.react.uimanager.ViewGroupManager.addView(ViewGroupManager.java:37)
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:533)
at com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren(ReanimatedNativeHierarchyManager.java:306)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:217)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:915)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1026)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1086)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1035)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:775)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Same stack trace here, I can say that the device in question is also OnePlus. I can't reproduce it in the emulator (I know how the user triggers it). So might be brand specific? Not sure.
I am actually experiencing this issue as well on production and emulator.
It happens only at app start though, I have to close the app the re-open it to reproduce.
Reloading / refreshing does not make the emulator crash.
I think this is also related to this: https://github.com/facebook/react-native/issues/27552
No updates on this? The library is basically unusable in the latest version of Expo sdk.
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
@robertwt7 Were you able to find any solution or a possible work around for this issue? We are also facing same issue as you, happens once per launch/install on Android.
We faced the same stack trace sometimes upon reloading the app.
In our case, we are using wix's react-native-navigation
library (v7.26.0)
Updating react-native-navigation
to the latest version seems to fix it.
I seem to be getting same issue on Android using [email protected]
Fatal Exception: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:5958) at android.view.ViewGroup.addView(ViewGroup.java:5777) at com.facebook.react.views.view.ReactViewGroup.addView(ReactViewGroup.java:514) at android.view.ViewGroup.addView(ViewGroup.java:5717) at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:38) at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:19) at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:533) at com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren(ReanimatedNativeHierarchyManager.java:300) at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:217) at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:926) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1037) at com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches() at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1097) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:994) at android.view.Choreographer.doCallbacks(Choreographer.java:794) at android.view.Choreographer.doFrame(Choreographer.java:725) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7814) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)