-
-
Notifications
You must be signed in to change notification settings - Fork 980
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] IllegalArgumentException crash with 0.64-rc.2 #1284
Comments
Thanks for bringing up this issue. This is likely a compatibility issue as you mentioned. |
Unfortunately I can't repro it although I'm seeing it pop up quite frequently on our crash reporting tool. My guess is the app is already in some sort of closing state and a touch is registered, but I was hoping someone had experienced a similar issue and could shed some light on this. |
I had a lot of similar crashes happening in my app, not deterministic, only showed up in production crash reporting. Eventually I had to remove react-native-gesture-handler and react-native-reanimated. After that almost all crashes are gone. I think that these packages, while nice, are unfortunately pretty unstable across the broad spectrum of Android devices. I never had any crashes on iOS. |
This crash happens for me when trying to scroll our date picker: https://github.com/henninghall/react-native-date-picker |
I have that crash on |
@tomasswood we have exactly the same problem. Have you had any luck finding out why this happens? Our problems started when we were updating a lot of dependencies and have not yet figured out which one started causing the error. it had been working fine for a long time before. If this has something to do with |
@tomasswood @rennehir I have the same issue. Downgrading |
@rennehir @vilindberg it happened after updating to RN-0.64.0 for me |
Also seeing this crash with |
However, there is a crash in release versions when clicking on the category input while adding new food. This is likely the reason: software-mansion/react-native-gesture-handler#1284
Hi,
Related issue in the *To be honest. I'm not sure if it's something on the |
Hi, Here are my dependencies: I still wonder why this related to |
same here wiith rncamera |
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? 🤔 |
@mikehardy Yes, that's a good point. |
@mikehardy and @DanielMarkiel are right - gesture handler is showing up just because we pass event data to be handled by RN. We don't have any repro as well so I'm going to close this one. If you have strong evidence with reproduction example then feel free to open another issue. |
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 |
This link has video explanation of what UIManager is in React Native https://youtu.be/QwoQgzBgJu8?t=883 RNGestureHandlerEnabledRootView inherits from ReactRootView Lines 34 to 40 in 4d598c1
The android ViewGroup calls onInterceptTouchEvent a method overridden by ReactRootView intercepted = onInterceptTouchEvent(ev); public boolean onInterceptTouchEvent(MotionEvent ev) {
dispatchJSTouchEvent(ev);
return super.onInterceptTouchEvent(ev);
} The error is casued by the UIManager trying to dispatch this event to JavaScript via the bridge. /**
* Main catalyst view is responsible for collecting and sending touch events to JS. This method
* reacts for an incoming android native touch events ({@link MotionEvent}) and calls into {@link
* com.facebook.react.uimanager.events.EventDispatcher} when appropriate. It uses {@link
* com.facebook.react.uimanager.TouchTargetHelper#findTouchTargetView} helper method for figuring
* out a react view ID in the case of ACTION_DOWN event (when the gesture starts).
*/
public void handleTouchEvent(MotionEvent ev, EventDispatcher eventDispatcher) {
int action = ev.getAction() & MotionEvent.ACTION_MASK;
if (action == MotionEvent.ACTION_DOWN) {
if (mTargetTag != -1) {
FLog.e(
ReactConstants.TAG, "Got DOWN touch before receiving UP or CANCEL from last gesture");
}
// First event for this gesture. We expect tag to be set to -1, and we use helper method
// {@link #findTargetTagForTouch} to find react view ID that will be responsible for handling
// this gesture
mChildIsHandlingNativeGesture = false;
mGestureStartTime = ev.getEventTime();
mTargetTag = findTargetTagAndSetCoordinates(ev);
eventDispatcher.dispatchEvent(
TouchEvent.obtain(
getSurfaceId(),
mTargetTag,
TouchEventType.START,
ev,
mGestureStartTime,
mTargetCoordinates[0],
mTargetCoordinates[1],
mTouchEventCoalescingKeyHelper)); /**
* Class responsible for dispatching UI events to JS. The main purpose of this class is to act as an
* intermediary between UI code generating events and JS, making sure we don't send more events than
* JS can process.
*
* <p>To use it, create a subclass of {@link Event} and call {@link #dispatchEvent(Event)} whenever
* there's a UI event to dispatch.
*
* <p>This class works by installing a Choreographer frame callback on the main thread. This
* callback then enqueues a runnable on the JS thread (if one is not already pending) that is
* responsible for actually dispatch events to JS. This implementation depends on the properties
* that 1) FrameCallbacks run after UI events have been processed in Choreographer.java 2) when we
* enqueue a runnable on the JS queue thread, it won't be called until after any previously enqueued
* JS jobs have finished processing
**/
/** Sends the given Event to JS, coalescing eligible events if JS is backed up. */
public void dispatchEvent(Event event) {
Assertions.assertCondition(event.isInitialized(), "Dispatched event hasn't been initialized");
for (EventDispatcherListener listener : mListeners) {
listener.onEventDispatch(event);
}
synchronized (mEventsStagingLock) {
mEventStaging.add(event);
Systrace.startAsyncFlow(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, event.getEventName(), event.getUniqueID());
}
maybePostFrameCallbackFromNonUI();
} The JavaScript module is not found and triggers the above error public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {
return mJSModuleRegistry.getJavaScriptModule(this, jsInterface);
} 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 🙏 ☮ |
Since upgrading to RN 0.64 we're seeing the following crash on Android:
IllegalArgumentException
Unable to find JSIModule for class UIManager
I haven't been able to reproduce the issue.
Could this be a compatibility issue with the new version of React Native?
The text was updated successfully, but these errors were encountered: