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

iOS app crash on tap onTouchesUp/onTouchesDown #2782

Closed
ghost opened this issue Feb 22, 2024 · 6 comments
Closed

iOS app crash on tap onTouchesUp/onTouchesDown #2782

ghost opened this issue Feb 22, 2024 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 22, 2024

Description

On Andoid all work fine, iOS app crash when call method onTouchesUp/onTouchesDown of Tap()

Create default RN project, add reanimated, geasture, add some code like this:

    "react": "18.2.0",
    "react-native": "0.73.4",
    "react-native-gesture-handler": "^2.15.0",
    "react-native-reanimated": "^3.7.1"
const gesture = Gesture.Tap().onTouchesUp(() => {});

<GestureDetector gesture={gesture}>
<Animated.View>
  <Section title="Step One">
    Edit <Text style={styles.highlight}>App.tsx</Text> to change
    this screen and then come back to see your edits.
  </Section>
</Animated.View>
</GestureDetector>

When tap block, app crash log:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITouchesEvent locationInView:]: unrecognized selector sent to instance 0x6000039184e0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff80048d28d __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff800057894 objc_exception_throw + 48
	2   CoreFoundation                      0x00007ff8004a23a3 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00007ff800491a20 ___forwarding___ + 1459
	4   CoreFoundation                      0x00007ff800493c28 _CF_forwarding_prep_0 + 120
	5   NOA                                 0x000000010049514a -[RNGestureHandlerPointerTracker extractPointerData:forTouch:] + 186
	6   NOA                                 0x00000001004957a2 -[RNGestureHandlerPointerTracker touchesBegan:withEvent:] + 450
	7   NOA                                 0x00000001004a1470 -[RNBetterTapGestureRecognizer interactionsBegan:withEvent:] + 144
	8   NOA                                 0x00000001004a1c24 -[RNBetterTapGestureRecognizer touchesBegan:withEvent:] + 180
	9   UIKitCore                           0x000000011a16b86a -[UIGestureRecognizer _componentsBegan:withEvent:] + 133
	10  UIKitCore                           0x000000011a893fb0 -[UITouchesEvent _sendEventToGestureRecognizer:] + 307
	11  UIKitCore                           0x000000011a15ac84 -[UIGestureEnvironment _updateForEvent:window:] + 483
	12  UIKitCore                           0x000000011a831c3e -[UIWindow sendEvent:] + 5262
	13  UIKitCore                           0x000000011a806e6c -[UIApplication sendEvent:] + 772
	14  UIKitCore                           0x000000011a8b3b99 __dispatchPreprocessedEventFromEventQueue + 8406
	15  UIKitCore                           0x000000011a8b6455 __processEventQueue + 8414
	16  UIKitCore                           0x000000011a8ac8d6 __eventFetcherSourceCallback + 163
	17  CoreFoundation                      0x00007ff8003e9d0f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	18  CoreFoundation                      0x00007ff8003e9c51 __CFRunLoopDoSource0 + 157
	19  CoreFoundation                      0x00007ff8003e944e __CFRunLoopDoSources0 + 215
	20  CoreFoundation                      0x00007ff8003e3b83 __CFRunLoopRun + 919
	21  CoreFoundation                      0x00007ff8003e3409 CFRunLoopRunSpecific + 557
	22  GraphicsServices                    0x00007ff80a650187 GSEventRunModal + 137
	23  UIKitCore                           0x000000011a7e63a2 -[UIApplication _run] + 972
	24  UIKitCore                           0x000000011a7eae10 UIApplicationMain + 123
	25  NOA                                 0x00000001000041d0 main + 96
	26  dyld                                0x00000001052023ee start_sim + 10
	27  ???                                 0x000000010bb0b3a6 0x0 + 4491096998
)
libc++abi: terminating due to uncaught exception of type NSException

Steps to reproduce

  1. Install default RN project
  2. Install Reanimated
  3. Install Gesture
  4. Call Gesture.Tap().onTouchesUp(() => {}); or Gesture.Tap().onTouchesDown(() => {});

Snack or a link to a repository

Gesture Handler version

2.15.0

React Native version

0.73.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

Simulator or iPhone devices

Acknowledgements

Yes

Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: iOS This issue is specific to iOS label Feb 22, 2024
@RRaideRR
Copy link

Hey,

I have this problem as well. It worked well in 2.14.0, so it was introduced in 2.15.0.

@m-bert
Copy link
Contributor

m-bert commented Feb 27, 2024

Hi @anatoolybinerals, @RRaideRR! I will look into it tomorrow, but I before I do this, could you please check if this PR helps? It was merged, but not released yet.

@RRaideRR
Copy link

Hey @m-bert ,

thanks a lot for looking into this 🙏.

If I haven't done anything wrong in my project setup and correctly applied your PR, then...

... 🥁🥁🥁 ...

it works 👏🎊🎉

@m-bert
Copy link
Contributor

m-bert commented Feb 28, 2024

That's great! I've also tried to reproduce this issue on our current main and I haven't had that problem.

I'm closing this, but feel free to reopen it in case if it wasn't actually fixed.

@m-bert m-bert closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants