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

App immediately crash using runOnJS? #2003

Closed
1 task
gpbaculio opened this issue May 7, 2021 · 6 comments
Closed
1 task

App immediately crash using runOnJS? #2003

gpbaculio opened this issue May 7, 2021 · 6 comments

Comments

@gpbaculio
Copy link

app closing immediately

Expected behavior

Actual behavior & steps to reproduce

Snack or minimal code example

  const setIngredient = useCallback(() => {
    setState({
      ...state,
      [ingredient]: Math.max(...Object.values(state)) + 1,
    });
  }, [state, ingredient, setState]);
  const onGestureEvent = useAnimatedGestureHandler({
    onActive: ({ translationX, translationY }) => {
      translateX.value = translationX;
      translateY.value = translationY;
    },
    onEnd: ({ velocityY }) => {
      "worklet";

      const destination = snapPoint(translateY.value, velocityY, [
        0,
        -HEADER_HEIGHT,
      ]);
      translateX.value = withTiming(0);
      translateY.value = withTiming(0, {}, () => {
        opacity.value = 1;
      });
      if (destination !== 0) {
        opacity.value = 0;
        runOnJS(setIngredient)();
      }
    },
  });

Package versions

  • React Native: 0.64
  • React Native Reanimated: 2.1.0
  • NodeJS: v12.21.0
  • Xcode: 12.5
  • Java & Gradle:

Affected platforms

  • [ x] Android
  • [ x] iOS
  • Web
@github-actions
Copy link

github-actions bot commented May 7, 2021

Issue validator

The issue is invalid!

  • Section required but not found: description(for label 🐞 bug)
  • Section expected behavior seems to be empty(for label 🐞 bug)
  • Section actual behavior & steps to reproduce seems to be empty(for label 🐞 bug)

@mrousavy
Copy link
Contributor

mrousavy commented May 8, 2021

Could you share your native logs?

In Xcode open the "Debug Area", in Android Studio show "Logcat" (or run adb logcat), then share the relevant lines here.

@gpbaculio
Copy link
Author

@mrousavy this is on my system log when it closes:

(UIKitApplication:org.reactjs.native.example.rnPizzaAnimated[dd03][rb-legacy][31448]): Service exited due to SIGBUS | sent by exc handler[31448]

and my stackoverflow question.

@jmysliv
Copy link
Member

jmysliv commented Aug 24, 2021

Hi @gpbaculio! Are you still encounter this issue? Have you tried to upgrade reanimated to 2.3.0-alpha.2?

@jmysliv jmysliv self-assigned this Aug 24, 2021
@gpbaculio
Copy link
Author

@jmysliv updating react + reanimated fix

@GunnarAK
Copy link

GunnarAK commented Oct 6, 2023

For any people that are currently running into this with Reanimated v3.5:

I had this very similar issue as well with the following snippet in my Splashscreen component

opacity.value = withTiming(0, { duration: fadeOutTime }, () =>
  runOnJS(setBootSplashIsVisible)(false),
);

The issue was related to Reanimated 3.5.1 and the issue was fixed in 3.5.2. I upgraded to this and could confirm it was fixed. Upgrading to current latest (3.5.4) also proved it was fixed. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants