-
-
Notifications
You must be signed in to change notification settings - Fork 961
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 ANR triggered when referencing a method in gesture's worklet in FlatList item #2410
Comments
Additional comments:
|
Some context on the actual app (in case it's useful):
|
Hi! While I was able to quite easily reproduce it using your snack, I wasn't able to when using Reanimated 3.0.0-rc.10. It includes a new implementation of shareable values so I doubt that it will be backported to Reanimated 2. I would recommend upgrading it if possible. |
@j-piasecki thanks for checking this out! Is there a solution for reanimated 2? Upgrading is not possible for now (this is for a package, so users have different versions) (reanimated 3 is still in RC state). Any pointers as to why it happens? I suspect it might have to do with mounting and dismounting components, combined with the FlatList internal virtualization (disclaimer: I'm not familiar with RNGH or reanimated code) |
Unfortunately, I don't think so 😞.
From a brief profiling session, it seems like Reanimated gets deadlocked. Fixing problems like that was one of the main points of the new implementation. |
Fair enough. Thanks, @j-piasecki! |
Description
An ANR (Application Not Responding) is triggered in Android when using a Gesture in FlatList's items, iff a JS method is referenced inside a worklet (e.g. inside
onEnd
callback). The app needs to be restarted after the ANR (i.e. waiting does not work)Expected behavior: no ANR is triggered. Note: the large amount of items might lag the application and impact performance hugely, but that is out of the scope of this bug
Steps to reproduce
runOnJS(someCallback)()
). Only referencing the method is enough to trigger the ANR, calling the method is not necessarywindowSize
) and an ANR will be triggeredHere is a small code sample with the core idea (see snack for a full repro)
Snack or a link to a repository
https://snack.expo.dev/@pdpino/rngh-bug-closure
Gesture Handler version
2.9.0
React Native version
0.69.6
Platforms
Android
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Android emulator
Device model
Android 13
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: