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

Issue: java.lang.IllegalArgumentException: pointerIndex out of range #12085

Closed
wants to merge 4 commits into from

Conversation

mobinni
Copy link

@mobinni mobinni commented Jan 26, 2017

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

Explain the motivation for making this change. What existing problem does the pull request solve?

Currently when implementing a Carousel in React Native ScrollView when you add pinch-to-zoom or some other type of touch handler, functionality the onTouchEvent can crash sometimes on Android.

see:
alwx/react-native-photo-view#15
alwx/react-native-photo-view#22
https://code.google.com/p/android/issues/detail?id=18990
Baseflow/PhotoView#293
Baseflow/PhotoView#81

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 26, 2017
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

return true;
}
} catch (Exception e) {
// Swallow error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should handle the error close to the place where it occurs - either prevent it from happening or log it. Never swallow exceptions.

Please use 2 spaces for indentation.

@mkonicek
Copy link
Contributor

I'll close this for now but please feel free to open a new PR that fixes the root cause or handles the error at the exact line where it's happening and logs it.

@mkonicek mkonicek closed this Jan 30, 2017
facebook-github-bot pushed a commit that referenced this pull request Feb 17, 2018
Summary:
Fork and rebase of gillessed's PR #13166 which has gotten stale.

From original PR:

Motivation (required)

Multiple react native developer (including myself) have run into a crash with the react-native-photo-view library (and possibly others). The common solution to this problem lies in the underlying java code, and thus requires a change in the react native source.

The stack trace I am getting is the same as listed here alwx/react-native-photo-view#15.

There was a PR to fix this (#12085) but it was closed. In response to the comments there, in my PR, I do log the exceptions. I don't think we can get any closer to the exception because in the next level of the stack trace, we are in the android sdk code.

Looking at some stack overflow pages and the android bug tracker, it seems that this is the common solution to this bug, and does not cause any impact any functionality.

https://code.google.com/p/android/issues/list?can=1&q=pointerindex+out+of+range&colspec=ID+Status+Priority+Owner+Summary+Stars+Reporter+Opened&cells=tiles

Test Plan (required)

I have manually tested this by compiling react native android from source and have confirmed the exception still gets hit and logged, but does not cause the app to terminate.
Closes #17167

Differential Revision: D7014296

Pulled By: hramos

fbshipit-source-id: 06b4a31062a591b726d2021e877d16f49881dcfd
Plo4ox pushed a commit to Plo4ox/react-native that referenced this pull request Feb 17, 2018
Summary:
Fork and rebase of gillessed's PR facebook#13166 which has gotten stale.

From original PR:

Motivation (required)

Multiple react native developer (including myself) have run into a crash with the react-native-photo-view library (and possibly others). The common solution to this problem lies in the underlying java code, and thus requires a change in the react native source.

The stack trace I am getting is the same as listed here alwx/react-native-photo-view#15.

There was a PR to fix this (facebook#12085) but it was closed. In response to the comments there, in my PR, I do log the exceptions. I don't think we can get any closer to the exception because in the next level of the stack trace, we are in the android sdk code.

Looking at some stack overflow pages and the android bug tracker, it seems that this is the common solution to this bug, and does not cause any impact any functionality.

https://code.google.com/p/android/issues/list?can=1&q=pointerindex+out+of+range&colspec=ID+Status+Priority+Owner+Summary+Stars+Reporter+Opened&cells=tiles

Test Plan (required)

I have manually tested this by compiling react native android from source and have confirmed the exception still gets hit and logged, but does not cause the app to terminate.
Closes facebook#17167

Differential Revision: D7014296

Pulled By: hramos

fbshipit-source-id: 06b4a31062a591b726d2021e877d16f49881dcfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants