react-native-gesture-handler: [Android] IllegalArgumentException crash with 0.64-rc.2
Since upgrading to RN 0.64 we’re seeing the following crash on Android:
IllegalArgumentException Unable to find JSIModule for class UIManager
java.lang.IllegalArgumentException:
at com.facebook.react.bridge.JSIModuleRegistry.getModule (JSIModuleRegistry.java:39)
at com.facebook.react.bridge.CatalystInstanceImpl.getJSIModule (CatalystInstanceImpl.java:2)
at com.facebook.react.uimanager.UIManagerHelper.getUIManager (UIManagerHelper.java:81)
at com.facebook.react.uimanager.UIManagerHelper.getUIManager (UIManagerHelper.java:1)
at com.facebook.react.uimanager.UIManagerHelper.getUIManagerForReactTag (UIManagerHelper.java:4)
at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent (NativeAnimatedNodesManager.java:17)
at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch (NativeAnimatedNodesManager.java:6)
at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent (EventDispatcherImpl.java:27)
at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent (JSTouchDispatcher.java:58)
at com.facebook.react.ReactRootView.dispatchJSTouchEvent (ReactRootView.java:49)
at com.facebook.react.ReactRootView.onInterceptTouchEvent (ReactRootView.java)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2753)
at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent (RNGestureHandlerEnabledRootView.java:12)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2845)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2845)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2845)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2845)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2845)
at com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:697)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1879)
at android.app.Activity.dispatchTouchEvent (Activity.java:3487)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:2)
at com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:655)
at android.view.View.dispatchPointerEvent (View.java:13732)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:6131)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:5909)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5358)
at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5411)
at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5377)
at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5536)
at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5385)
at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5593)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5358)
at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5411)
at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5377)
at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5385)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5358)
at android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:8420)
at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:8353)
at android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:8306)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:8535)
at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:198)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:326)
at android.os.Looper.loop (Looper.java:181)
at android.app.ActivityThread.main (ActivityThread.java:7050)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
I haven’t been able to reproduce the issue. Could this be a compatibility issue with the new version of React Native?
- React: 17.0.1
- React Native: 0.64.rc.2
- React Native Gesture Handler: 1.9.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 17 (2 by maintainers)
@rennehir @vilindberg it happened after updating to RN-0.64.0 for me
This link has video explanation of what UIManager is in React Native https://youtu.be/QwoQgzBgJu8?t=883
RNGestureHandlerEnabledRootView inherits from ReactRootView
https://github.com/software-mansion/react-native-gesture-handler/blob/4d598c173587ba1f080a1de106c5d798fbbf59aa/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java#L34-L40
The android ViewGroup calls onInterceptTouchEvent a method overridden by ReactRootView
https://github.com/aosp-mirror/platform_frameworks_base/blob/1ac46f932ef88a8f96d652580d8105e361ffc842/core/java/android/view/ViewGroup.java#L2664
https://github.com/facebook/react-native/blob/eacc94005b1b1d33d47b3bea88a6fd242560dafb/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java#L204-L207
The error is casued by the UIManager trying to dispatch this event to JavaScript via the bridge. The UIManager tries to retrieve the JavaScript Module responsible for handling this event, but no module is found and the consequent runtime is triggered.
https://github.com/facebook/react-native/blob/eacc94005b1b1d33d47b3bea88a6fd242560dafb/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java#L64-L95
The JavaScript module is not found and triggers the above error
would be interesting adding some debug statements in this react native source and see the different variables when using RNGestureHandlerEnabledRootView and normal React Native without Gesture Handler, to better understand the reason for this error. Thanks 🙏 ☮
I reproduced, minimal repro here: https://github.com/Bardiamist/jsimodule
I went through many options before I figured out that crash happening on react-native-camera view port press only when
PanGestureHandler
exist.This crash happens for me when trying to scroll our date picker: https://github.com/henninghall/react-native-date-picker
I can’t see how this is a gesture handler problem. Looks like gesture handler is just tickling a react-native issue based on the stack. How is gesture handler responsible for react-native’s UIManagerHelper finding the JSIModule for it’s own UIManager? 🤔
Also seeing this crash with
react-native-camera
. Tapping on the view port will cause this.Thanks for bringing up this issue. This is likely a compatibility issue as you mentioned. Is this crash deterministic and happens on every startup? Could you please provide some repro repository?
@tomasswood @rennehir I have the same issue. Downgrading
react-native-gesture-handler
to 1.9.0 did not help.