[Android] Need help debugging `IllegalArgumentException: Parent is null? View is no longer in the tree`
Hi.
According to crash logs of my app, my Android users from time to time catch IllegalArgumentException: Parent is null? View is no longer in the tree fatal error. I can't reproduce this issue myself, therefore I want to ask your help debugging this. My app is built using [email protected], [email protected] (and [email protected]). These crashes happen on various Android versions, and first I've seen this with [email protected] (or even with earlier versions RNGH, can't say for sure). In my app RNGH is used in many places: buttons, ScrollViews, react-native-tab-views, Swipeable, so I kinda don't even know how to approach this issue. Any advice?
All stacktraces are like this:
java.lang.IllegalArgumentException: Parent is null? View is no longer in the tree
at com.swmansion.gesturehandler.GestureHandlerOrchestrator.extractCoordsForView(GestureHandlerOrchestrator.java:318)
at com.swmansion.gesturehandler.GestureHandlerOrchestrator.extractCoordsForView(GestureHandlerOrchestrator.java:321) (This line repeats different number of times in different crash reports)
at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandler(GestureHandlerOrchestrator.java:300)
at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandlers(GestureHandlerOrchestrator.java:262)
at com.swmansion.gesturehandler.GestureHandlerOrchestrator.onTouchEvent(GestureHandlerOrchestrator.java:102)
at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent(RNGestureHandlerRootHelper.java:121)
at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.java:31)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2864)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2549)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2864)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2549)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2864)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2549)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:605)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
at android.app.Activity.dispatchTouchEvent(Activity.java:3241)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:567)
at android.view.View.dispatchPointerEvent(View.java:11008)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5155)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5007)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4532)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4585)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4551)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4684)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4559)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4741)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4532)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4585)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4551)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4559)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4532)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7092)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7024)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6985)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7202)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7166)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:7229)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959)
at android.view.Choreographer.doCallbacks(Choreographer.java:734)
at android.view.Choreographer.doFrame(Choreographer.java:664)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
@kmagiera, @osdnk?
Hi @angly-cat I regret to say that this should never happen and we'll try to find out what's the issue.
Hi @angly-cat I think I have some ideas on how this can be reproduces. We hope to get back to you on this one soon
I didn't manage to reproduce it. Maybe could be try to maker this error silent @kmagiera?
... or change to Log.e
@kmagiera @osdnk @angly-cat This is happening for my Android users too. Did someone found the reason?
@kmagiera Do you have any ideas?
My Android users also see this error occasionally. Any idea what causes it or how it can be avoided?
Bump
I'm going to ship 1.0.15 which presumably fixed the issue with a next release of my app.
Btw, apparently until recently two versions of RNGH were bundled in my app. Yarn messed up for some reason, and my app ended up with linked 1.0.12 which were used as is and unlinked 1.0.10 which came as a dependency of react-native-tab-view. The next release of my app will be shipped without duplicated RNGH as well. I wonder if that could've led to the issue.
Hi everyone, this issue appears to be resolved in a new release.
If you still face the problem, please let me know.
@angly-cat @osdnk Awesome!
I just released a version of my app using 1.0.15.
If I find something odd, I'll let you know.
Thanks.