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

100% reproducible crash in simplest basic application [Android only] #2905

Closed
2 tasks
Omelyan opened this issue Jan 30, 2022 · 3 comments
Closed
2 tasks

100% reproducible crash in simplest basic application [Android only] #2905

Omelyan opened this issue Jan 30, 2022 · 3 comments
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@Omelyan
Copy link

Omelyan commented Jan 30, 2022

Description

About two months ago 100% recreating crash was issued #2722, in the simplest and fundamental case, even an PR was made #2853, still no reaction...
Here it is:

Actual behavior & steps to reproduce

"npx react-native init test"
install react-native-reanimated (installation for Android)
replace "App.js" by the following code and run "npx react-native run-android --variant=release"

Snack or minimal code example

import React, {useEffect} from 'react';

import Reanimated, {
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from 'react-native-reanimated';

const App = () => {
  const sv = useSharedValue(0);

  const rs = useAnimatedStyle(() => ({
    transform: [{translateY: sv.value}],
  }));

  useEffect(() => {
    sv.value = withTiming(500, {duration: 3000});
  }, [sv]);

  return (
    <Reanimated.View
      style={[{height: 100, aspectRatio: 1, backgroundColor: 'tomato'}, rs]}
    />
  );
};

export default App;

It will crash if run in release mode (API 29 or below). But if you run it in dev. mode, then nope.
Also, it won't crash if you replace transform: [{translateY: sv.value}] with transform: [{translateY: 0}] or add a delay before rendering the styled element.

Package versions

The latest.
Should note that this bug appeared in the latest 2.3.x release and in the previous one everything was fine.

Affected platforms

  • [x ] Android
  • iOS
  • Web
@Omelyan Omelyan added the Needs review Issue is ready to be reviewed by a maintainer label Jan 30, 2022
@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided labels Jan 30, 2022
@kmagiera
Copy link
Member

kmagiera commented Feb 2, 2022

Hi @Omelyan – thank you for reporting the issue. It does not seem, however, like this can be reproduced using the steps you provided. The issue and PR you link to fixes the use-case of animating third-party component properties and we have not been able to reproduce this behavior for things like regular view's transforms (they are always of the correct type).

In any case, it would be easier if you'd provided the versions you are using as the issue seem to be specific to your setup – either the version of packages you are using or the type of device you are running the test on. For comparison the versions I tested your app with are:

"react": "17.0.2",
"react-native": "0.67.2",
"react-native-reanimated": "^2.3.1

I run the test on Android SDK 30 emulator.

@joy-betterhalf
Copy link

@kmagiera This issue is happening to us as well and it seems like not happening on every device. @Omelyan It's better you provide more information like you face this crash on Emulator or Real device? Also if a Real device what's the device you are using?

@Latropos
Copy link
Contributor

Latropos commented Aug 4, 2023

Closed due to inactivity

@Latropos Latropos closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

4 participants