[Android] IllegalArgumentException crash with 0.64-rc.2
See original GitHub issueSince 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Wrong state class if the app was background for a period of ...
Android IllegalArgumentException : Wrong state class if the app was background for a period of time ... It looks like due to the...
Read more >Android 12 crash
Hello support team, We have recently migrated to Android 12 and started getting crashes pointing to your library.
Read more >IllegalArgumentException
IllegalArgumentException ; IllegalArgumentException; IllegalArgumentException ... Constructs an IllegalArgumentException with no detail message.
Read more >java.lang.IllegalArgumentException: ChunkNibbleArrays ...
If your server is crashing with the error java.lang.IllegalArgumentException: ChunkNibbleArrays should be 2048 bytes not: 0 , it means that your world is ......
Read more >[Android S] java.lang.IllegalArgumentException [194108978]
On the 'App launch' retrieved the crash (everywhere in the app applied FLAG_IMMUTABLE or FLAG_MUTABLE to the using PendingIntents): java.lang.
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
@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 🙏 ☮