Skip to content
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

Android Fatal Native Exception #220

Closed
kevinvangelder opened this issue Mar 2, 2021 · 28 comments
Closed

Android Fatal Native Exception #220

kevinvangelder opened this issue Mar 2, 2021 · 28 comments

Comments

@kevinvangelder
Copy link

When attempting to open the picker on Android, I get:

Fatal native exception 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:2609)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
	at android.app.Activity.dispatchTouchEvent(Activity.java:3993)
	at com.gasbuddy.MainActivity.dispatchTouchEvent(MainActivity.java:43)
	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
	at android.view.View.dispatchPointerEvent(View.java:13674)
	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5482)
	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5285)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7505)
	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7474)
	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7435)
	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7630)
	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
	at android.os.MessageQueue.nativePollOnce(Native Method)
	at android.os.MessageQueue.next(MessageQueue.java:336)
	at android.os.Looper.loop(Looper.java:174)
	at android.app.ActivityThread.main(ActivityThread.java:7356)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

React: 17.0.1
React Native: 0.64.0-rc4
React Native Picker: 1.9.11

@sylvainbaronnet
Copy link

Same issue, I reported it here : lawnstarter/react-native-picker-select#422

@fabOnReact
Copy link

@sylvainbaronnet https://youtu.be/QwoQgzBgJu8?t=946

@kevinvangelder
Copy link
Author

@sylvainbaronnet Your issue has a lot more info in it, I'll close mine in favor of yours.

@sylvainbaronnet
Copy link

sylvainbaronnet commented Mar 5, 2021

@kevinvangelder I recommend you to keep it opens because mine is on another package

@kevinvangelder kevinvangelder reopened this Mar 5, 2021
@natwallbank
Copy link

Are you using this with @react-navigation? I've just had this same issue since upgrading to 0.64 and found that this problem occurred on screens where I had enabled gestures (gestureEnabled: true in screenOptions).

@ghost
Copy link

ghost commented Mar 17, 2021

(gestureEnabled: true in screenOptions).

You save me 👍

@kevinvangelder
Copy link
Author

@natwallbank Yes I am, thanks for the info.

@kevinvangelder
Copy link
Author

Sadly, this fix doesn't work for me as the picker is in a MaterialTopTabNavigator and swipeEnabled={false} doesn't resolve the crash. As far as I can tell, gesturesEnabled isn't a valid option for a TabNavigator.

@natwallbank
Copy link

Sadly, this fix doesn't work for me as the picker is in a MaterialTopTabNavigator and swipeEnabled={false} doesn't resolve the crash. As far as I can tell, gesturesEnabled isn't a valid option for a TabNavigator.

Is that MaterialTopTabNavigator referenced as a Screen? If so, you can supply it as options there I think?

@kevinvangelder
Copy link
Author

@natwallbank Good thought. I gave that a shot and I'm still getting the native exception.

@smontiu
Copy link

smontiu commented Mar 25, 2021

I can confirm the issue, I just update my app and the test start to fail.

@jonra1993
Copy link

I am facing the same issue. Have you guys have found any solution?

"react": "17.0.1"
"react-native": "0.64.0"
"@react-native-picker/picker": "^1.12.0"

@jonra1993
Copy link

jonra1993 commented Mar 26, 2021

After lots of hours facing this issue our team discovered that in our case this package "react-native-snap-carousel" was causing the issue, I am not sure yet why but we deleted the carousel component and pickers of all the screens worked again. The really weird thing is that we used carousel package on different screens than pickers but when we go to any carousel view and return to picker view it fails.

@sylvainbaronnet
Copy link

I also use react-native-snap-carousel in the app that has this issue, on another one where we don't use that lib, the picker doesn't crash on Android.

@jonra1993
Copy link

jonra1993 commented Mar 27, 2021

@sylvainbaronnet react-native-snap-carousel is causing that bug on the repository it has not been updated since May 2020, so we decided to use react-native-swiper-flatlist and react-native-fast-image instead our app is running again and pickers are working as is expected. Maybe for others facing this bug, the problem is in another depreciated package.

@sylvainbaronnet
Copy link

@jonra1993 Thanks a lot for the recommendation

@jyotirmoym
Copy link

I am facing the same issue. Has anybody found any solution?

"react": "17.0.1"
"react-native": "0.64.0"
"@react-native-picker/picker": "^1.12.0"
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",

I tried the approach mentioned by @natwallbank but it did not fix the issue.

@smontiu
Copy link

smontiu commented Mar 30, 2021

I am not using any kind of carousel, swipe, or moving component to affect or interfere with the picker itself. Picker's inside a View and that View inside a stack.

"react": "16.13.1",
"react-native": "0.64.0",
"@react-native-picker/picker": "^1.9.8",
"@react-navigation/bottom-tabs": "^5.11.2",
"@react-navigation/material-top-tabs": "^5.3.10",
"@react-navigation/native": "^5.8.10",
"@react-navigation/stack": "^5.12.8"

@Jexim
Copy link

Jexim commented Apr 7, 2021

I have the same problem with my project. Also, I use react-native-snap-carousel.
I was trying to delete react-native-snap-carousel but it did not give a result.
So I'm not sure about it's related.

@ehdwns980416
Copy link

Are you using this with @react-navigation? I've just had this same issue since upgrading to 0.64 and found that this problem occurred on screens where I had enabled gestures (gestureEnabled: true in screenOptions).

Awesome 🙇

@mbouxin
Copy link

mbouxin commented May 6, 2021

Hi all the problem is from react-native and they are working on a fix. Basically their problem is because they try to use the id of the inflated picker while it is not set.

If it is of any use to someone, I temporarily fixed the problem on my project by making the following modifications

In TextViewImpl.java and CheckedTextViewImpl.java

4a5
> import android.view.View;
23a25,33
>     private View pickerView;
>     public int getId() {
>         return pickerView.getId();
>     }
> 
>     public void setPickerView(View pickerView) {
>         this.pickerView = pickerView;
>     }
> 

In ReactPickerManager.java

188a189,194
>       if (convertView instanceof TextViewImpl) {
>         ((TextViewImpl) convertView).setPickerView(parent);
>       } else if (convertView instanceof CheckedTextViewImpl) {
>         ((CheckedTextViewImpl) convertView).setPickerView(parent);
>       }
> 

It definitely is a bypass that should not be included in the sources but it solves the issue without changing used packages

@allenmanning
Copy link

allenmanning commented May 7, 2021

they are working on a fix.

@mbouxin Do you happen to have an issue we can track on this?

@mbouxin
Copy link

mbouxin commented May 7, 2021

they are working on a fix.

@mbouxin Do you happen to have an issue we can track on this?

facebook/react-native#31245

@mitrukahitesh
Copy link

Are you using this with @react-navigation? I've just had this same issue since upgrading to 0.64 and found that this problem occurred on screens where I had enabled gestures (gestureEnabled: true in screenOptions).

gestureEnabled: false works. Thanks

@LuizFBrisighello
Copy link

Here is the commit that will be cherry picked for .64.2 facebook/react-native@b0e8c1e
And thats the issue for the discussion react-native-community/releases#224

@hasibulHossain
Copy link

Are you using this with @react-navigation? I've just had this same issue since upgrading to 0.64 and found that this problem occurred on screens where I had enabled gestures (gestureEnabled: true in screenOptions).

thank you, you save me

@mikehardy
Copy link

@kevinvangelder this is close-able react-native 0.64.2 is out with the fix for this included

@Naturalclar
Copy link
Contributor

This was a bug on React Native's side, should be fixed on React Native 0.64.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests