meliorence / meliorence/react-native-snap-carousel
App crashes on android 12 devices due to useNativeDriver true on slide animations
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Is this a bug report, a feature request, or a question?
Bug Report
Have you followed the required steps before opening a bug report?
(Check the step you've followed - put an x character between the square brackets ([]).)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- I have searched for existing issues and made sure that the problem hasn't already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn't a React Native bug?
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
It is specific to android, however it is not easily reproducible but we have instances of this crash on our firebase for our users.
Is the bug reproductible in a production environment (not a debug one)?
Not reproducible but occuring for large userbase.
Environment
Android (12.0)
Expected Behavior
Should run fine with given default configurations
Actual Behavior
Currently their is no provision to enable/disable useNativeDriver for react native snap carousal. For carousal animations useNativeDriver is set to true i.e they run on UI thread by default. We encountered some crashes related to Animated node that occurred only on Android 12 devices and after digging into it we get to know it is related to useNativeDriver set to true for carousal animations. Also their is an open issue in react-native related to this crash: Link. So we added a patch in react-native-snap-carousal library for disabling useNativeDriver for devices having Android 12 and that reduces the crash rate for that crash with very few instances now. We have been using this for almost a year and haven't faced any issue with our app exposed to more than 20 million users. So we though of adding support for enable/disable useNativeDriver for react-native-snap-carousal as a exposed prop.
Reproducible Demo
Not reproducible but occuring for large userbase having instances on firebase.
Steps to Reproduce
Their is no defined steps to reproduce this issue but we instances of this crash in our firebase for large numbers of users and it was reduced by setting useNativeDriver to false. Here is the stacktrace for it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the carousel animation entry points for useNativeDriver and inspect the supplied crash trace and linked React Native issue first. Define the smallest prop-facing behavior that lets callers enable or disable the driver, preserve the current default, and check the project's existing validation; no reproducible demo or test file is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100