meliorence / meliorence/react-native-snap-carousel

App crashes on android 12 devices due to useNativeDriver true on slide animations

Open
#1,011 1 comment 0 reactions 0 assignees View on GitHub

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 ([]).)

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.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.