software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.85k stars 1.29k forks source link

Android : physics based withSpring not working properly all the time when mass = 0.4 #5689

Open webfarmer-amy opened 7 months ago

webfarmer-amy commented 7 months ago

Description

The bug happens in dev and production modes. I confirmed it doesn't happen when mass = 1 or if I use a duration based spring animation. Tested and reproduced on two Android devices : Xiaomi Poco X4 GT and Samsung Galaxy A23.

Steps to reproduce

  1. Create a withSpring animation with mass: 0.4.
  2. Create other things and test your app
  3. You'll notice that sometimes, the animation doesn't happen. In my case, my hidden menu wouldn't appear.

Snack or a link to a repository

https://snack.expo.dev/@amy_hotcake/react-native-reanimated-withspring-bug

Reanimated version

3.7.0

React Native version

0.72.6

Platforms

Android

JavaScript runtime

None

Workflow

Expo Dev Client

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Latropos commented 6 months ago

@webfarmer-amy Hi! Unfortunately I was unable to reproduce your issue on my simulator. Could you tell how often the bug approximately happens? Also did you provide any additional config except for the mass?

webfarmer-amy commented 6 months ago

About 1/2 times. Like, when I open the app, all those animations won't work at all and I'll have to restart it and hope it starts working again. Would you like me to provide the list of all my dependencies?

Latropos commented 6 months ago

@webfarmer-amy Do you know if is it possible to reproduce the bug on simulator, or do I have to use a real device?

Would you like me to provide the list of all my dependencies?

Yes, please

webfarmer-amy commented 6 months ago

Hi! Sorry for the wait, I forgot to send you the info. Here are the dependencies:

{
"dependencies": {
    "@expo-google-fonts/nunito-sans": "^0.2.3",
    "@expo/vector-icons": "^13.0.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/datetimepicker": "7.2.0",
    "@react-navigation/native": "^6.0.2",
    "@tanstack/react-query": "^5.17.9",
    "axios": "^1.6.2",
    "expo": "^49.0.21",
    "expo-dev-client": "~2.4.13",
    "expo-font": "~11.4.0",
    "expo-image": "~1.3.5",
    "expo-linking": "~5.0.2",
    "expo-location": "~16.1.0",
    "expo-router": "^2.0.0",
    "expo-splash-screen": "~0.20.5",
    "expo-sqlite": "~11.3.3",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-web-browser": "~12.3.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.10",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-maps": "^1.7.1",
    "react-native-maps-markercluster": "^0.1.3",
    "react-native-paper-dates": "^0.21.8",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-uuid": "^2.0.1",
    "react-native-web": "~0.19.6",
    "reflect-metadata": "^0.2.1",
    "typeorm": "^0.3.19"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/es6-shim": "^0.31.45",
    "@types/node": "^20.10.8",
    "@types/react": "~18.2.14",
    "babel-plugin-transform-typescript-metadata": "^0.3.2",
    "jest": "^29.2.1",
    "jest-expo": "~49.0.0",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.1.3"
  },
}