-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to find JSIModule for class UIManager #31245
Comments
@Bardiamist I was able to resolve my case. It was caused by the usage of More details here -> satya164/react-native-tab-view#1157 |
Got the same issue when using |
The problem here is happening because the View getId() function is returning an even number and in react native code if the id is even it will use FABRIC and JSI and UIManager doesn't support that, so it is breaking, now the question is why it generates even number, |
@sharifhh fascinating! Can you point to the conditional in the react-native code that branches on even/odd view ids? And is there some specific library with an |
@mikehardy I guess it will happen in any library since android studio auto generates the ids for the views. https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java then here: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.java Line 22 in 24bfa46
it checks if the reactTag is even or not. then here again: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java line 85 it sees that the uiManagerType is FABRIC so it tries to call JSIModule for UIManager, As far as I know UIManager is deprecated right? why does it contain a code that uses JSIModule for UIManager? I don't think it will be supported right? |
@sharifhh that's great digging - if I git blame on there it all seems to point to @mdvacca and possibly @ejanzer (going from this 0a12f3e) - I think they might know more about the even/odd partitioning of dispatch event handling and specifically in the last commit how what appears to be a new exception raised affects other modules. Hopefully one of them has time to share their wisdom here on the crash as I think it's related to that change |
I think @mdvacca is probably the right person to weigh in on this one! It seems like the JS touch handler assumes it's only dealing with views that were created by React (in which case an even id == fabric) but that's clearly... not always the case? |
@ejanzer thanks for chiming in! This is vague, apologies, and I'm not sure at all if it advances things but most (all?) of the crashes appear tied to the PanGestureHandler in the crash stack, and that one does create a View per installation documentation:
Unfortunately |
@ejanzer, @sharifhh, @mikehardy thanks for looking into this. I agree with @ejanzer that this is caused by views that are not directly managed by React Native. In particular, we are referring to views that are not created by this method: I'll analyze what's the proper solution here and update the issue |
Hi, any update on this issue? Thanks for all! |
solve ~ thx |
In my case I face this same issue when I use datepicker along with react-native-snap-carousel |
Does anyone have any fix for this yet? |
downgraded react-native-tab-view to v2.16.0 can solve my error |
I'm not using |
I was able to easily reproduce this issue with: just mount this on some image and try to zoom with two fingers (even clicking into it make a crash)
|
So no one knows how to fix this, except by downgrading arbitrary libraries until it stops happening? And there's some crazy even-number/odd-number scheme involved? What is going on here? |
For the record, I was able to work around this bug by using |
@mdvacca Did you make any progress on this? The only option for us currently is to downgrade React Native :/ |
I found that pressing my location button on |
in my case using |
@efstathiosntonas interesting It creates a View directly itself: https://github.com/hhunaid/react-native-image-crop-tools/blob/5c3ab05dca20cefe542fd3824a40cef0ae2d2541/android/src/main/java/com/parsempo/ImageCropTools/ImageCropViewManager.kt#L31 Then the id for that View is apparently indigestible: https://github.com/hhunaid/react-native-image-crop-tools/blob/5c3ab05dca20cefe542fd3824a40cef0ae2d2541/android/src/main/java/com/parsempo/ImageCropTools/ImageCropViewManager.kt#L39 So, still seems to be the same case of "JSIModule is making an assumption about View ids that is no longer valid" and I believe we are still waiting for @mdvacca to report any findings as promised above |
…UIManager registered Summary: This diff refactors the UIManagerHelper.getUIManager method to return null when there's no UIManager registered for the uiManagerType received as a parameter. This is necessary to workaround: #31245 changelog: [changed] UIManagerHelper.getUIManager now returns null when there's no UIManager registered for the uiManagerType received as a parameter Reviewed By: fkgozali Differential Revision: D28242592 fbshipit-source-id: c3a4979bcf6e547d0f0060737e41bbf19860a984
I believe this should be closed, as there is a commit on master and it's been picked to release-0.65 as well |
…UIManager registered Summary: This diff refactors the UIManagerHelper.getUIManager method to return null when there's no UIManager registered for the uiManagerType received as a parameter. This is necessary to workaround: facebook#31245 changelog: [changed] UIManagerHelper.getUIManager now returns null when there's no UIManager registered for the uiManagerType received as a parameter Reviewed By: fkgozali Differential Revision: D28242592 fbshipit-source-id: c3a4979bcf6e547d0f0060737e41bbf19860a984
I fixed it this way |
…UIManager registered Summary: This diff refactors the UIManagerHelper.getUIManager method to return null when there's no UIManager registered for the uiManagerType received as a parameter. This is necessary to workaround: facebook#31245 changelog: [changed] UIManagerHelper.getUIManager now returns null when there's no UIManager registered for the uiManagerType received as a parameter Reviewed By: fkgozali Differential Revision: D28242592 fbshipit-source-id: c3a4979bcf6e547d0f0060737e41bbf19860a984
…UIManager registered Summary: This diff refactors the UIManagerHelper.getUIManager method to return null when there's no UIManager registered for the uiManagerType received as a parameter. This is necessary to workaround: #31245 changelog: [changed] UIManagerHelper.getUIManager now returns null when there's no UIManager registered for the uiManagerType received as a parameter Reviewed By: fkgozali Differential Revision: D28242592 fbshipit-source-id: c3a4979bcf6e547d0f0060737e41bbf19860a984
@mikehardy do you know if using master or 64-stable in package.json instead of 0.64.1 could be a workaround? When is this aar pre-built? |
@ebaynaud web search for building / running react native from source |
some solutions? i have a simple modal with useState[true/false] and button to open the modal. when i click on this button like 4-5 times before modal is showing, i have that crash. it may crash after 2-7 repeats. and error are same... |
@kirx76 the solutions are all here. Use react-native 0.63.x or wait for 0.64.2 and/or 0.65 or build from source with the patch. |
@mikehardy could you tell me if the fix is in v0.64.2? I don't see it referenced in the change log |
It is
On Fri 4 Jun 2021 at 18:01, Juan S. Escobar ***@***.***> wrote:
@mikehardy <https://github.com/mikehardy> could you tell me if the fix is
in v0.64.2? I don't see it referenced in the change log
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOVCFJGACVQT6QDVYZAFFTTRD2HFANCNFSM4Z277OKA>
.
--
Erwan
|
It's almost the only thing in the changelog? |
sorry, I must have missed it, thanks |
I tried to build it in the following way, but it did not improve.
diff`node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java` CatalystInstance catalystInstance = context.getCatalystInstance();
- return uiManagerType == FABRIC
- ? (UIManager) catalystInstance.getJSIModule(JSIModuleType.UIManager)
- : catalystInstance.getNativeModule(UIManagerModule.class);
+ try {
+ return uiManagerType == FABRIC
+ ? (UIManager) catalystInstance.getJSIModule(JSIModuleType.UIManager)
+ : catalystInstance.getNativeModule(UIManagerModule.class);
+ } catch (IllegalArgumentException ex) {
+ // TODO T67518514 Clean this up once we migrate everything over to bridgeless mode
+ ReactSoftException.logSoftException(
+ "UIManagerHelper",
+ new ReactNoCrashSoftException(
+ "Cannot get UIManager for UIManagerType: " + uiManagerType));
+ return catalystInstance.getNativeModule(UIManagerModule.class);
+ }
Is there some solutions to this problem? |
Fixed in 0.64.2 |
@Bardiamist Thank you so much. |
If you are updating jars or specific classes I must say you are completely on your own and need to have the sufficient skill / experience to do so, as it is not recommended and you will be on your own to fix any problems. There is literally nothing necessary other than changing the dependency, vastly simpler than any sort of back-port to 0.64.0 https://react-native-community.github.io/upgrade-helper/?from=0.64.0&to=0.64.2 |
@mikehardy , Thanks a lot, But i getting an error |
You do not need to do the upgrade no, you can just update the version in package.json and re-install yes |
@mikehardy, it worked, Thanks |
Description
After update to React native 0.64.0 many people have
Unable to find JSIModule for class UIManager
crash.There was no crash on the 0.63.4.
Related issues
software-mansion/react-native-gesture-handler#1284
react-native-community/releases#221 (comment)
React Native version:
React native info
System: OS: macOS 11.2.3 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 1.08 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 15.12.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.6.3 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.1 System Images: android-21 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.7199119 Xcode: 12.4/12D4e - /usr/bin/xcodebuild Languages: Java: 1.8.0_282 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.0 => 0.64.0 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not FoundSteps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Logcat
Logcat
2021-03-26 15:55:59.361 18259-18259/com.jsimodule E/InputEventReceiver: Exception dispatching input event. 2021-03-26 15:55:59.361 18259-18259/com.jsimodule E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback 2021-03-26 15:55:59.363 18259-18259/com.jsimodule E/MessageQueue-JNI: 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:2664) at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.java:39) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:488) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871) at android.app.Activity.dispatchTouchEvent(Activity.java:4125) at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:446) at android.view.View.dispatchPointerEvent(View.java:14568) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6016) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5819) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5310) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5485) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5542) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8080) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8031) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7992) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8203) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:220) at android.os.MessageQueue.nativePollOnce(Native Method) 2021-03-26 15:55:59.363 18259-18259/com.jsimodule E/MessageQueue-JNI: at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:183) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 2021-03-26 15:55:59.364 18259-18259/com.jsimodule D/AndroidRuntime: Shutting down VM2021-03-26 15:55:59.366 18259-18259/com.jsimodule E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.jsimodule, PID: 18259
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:2664)
at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.java:39)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2742)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:488)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871)
at android.app.Activity.dispatchTouchEvent(Activity.java:4125)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:446)
at android.view.View.dispatchPointerEvent(View.java:14568)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6016)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5819)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5310)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5485)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5542)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8080)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8031)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7992)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8203)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:220)
2021-03-26 15:55:59.366 18259-18259/com.jsimodule E/AndroidRuntime: at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loop(Looper.java:183)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-03-26 15:55:59.386 18259-18259/com.jsimodule I/Process: Sending signal. PID: 18259 SIG: 9
Expected Results
No crash
Snack, code example, screenshot, or link to a repository:
https://github.com/Bardiamist/jsimodule
The text was updated successfully, but these errors were encountered: