Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App crash with error: Unable to find JSIModule for class UIManager, after touch event on ad

Tags:

I've created a component to show ads in my react-native app using react-native-admob-native-ads.
It's running perfectly on most of the app screens, but on some screens, the app crashes just after the touch event on the ad, I don't understand the issue as it is fine on most of the screens, and the same component is used everywhere

This is the crash log

java.lang.IllegalArgumentException: Unable to find JSIModule for class UIManager
        at com.facebook.react.bridge.JSIModuleRegistry.getModule(JSIModuleRegistry.java:24)
        at com.facebook.react.bridge.CatalystInstanceImpl.getJSIModule(CatalystInstanceImpl.java:564)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:90)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:46)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManagerForReactTag(UIManagerHelper.java:40)
        at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:505)
        at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:483)
        at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
        at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:74)
        at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:283)
        at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:201)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2635)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2724)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2724)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2724)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2724)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2724)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:496)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1853)
        at android.app.Activity.dispatchTouchEvent(Activity.java:4059)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:454)
        at android.view.View.dispatchPointerEvent(View.java:13749)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5635)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5435)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4989)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4955)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5095)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4963)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5152)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4989)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4955)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4963)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7688)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7657)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7618)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7816)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:251)

How to fix this?

like image 336
Archit garg Avatar asked Jan 04 '21 08:01

Archit garg


1 Answers

This seems to be an issue in React Native 0.64.0. Someone is looking into it: https://github.com/facebook/react-native/issues/31245#issuecomment-811587180 It's also discussed in upcoming v0.64.1 cherrypicks, so there is a possibility that it will be fixed in the next version. In the meantime it can be fixed by downgrading React Native to 0.63.4.

like image 146
mihai1990 Avatar answered Oct 12 '22 22:10

mihai1990