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

Support react native reanimated 2 #64

Open
tamacroft opened this issue Mar 6, 2021 · 11 comments
Open

Support react native reanimated 2 #64

tamacroft opened this issue Mar 6, 2021 · 11 comments

Comments

@tamacroft
Copy link

is this lib support react native reanimated 2 which is required to use hermes in their documentation?

@Kudo
Copy link
Owner

Kudo commented Mar 9, 2021

reanimated2 creates a Hermes runtime in there code, the only way to support V8 should be patch reanimated2 and build from source unfortunately.

@hanhailong
Copy link

@Kudo When I switched the engine to V8,there was an error in reanimated2,this means that just switching engine code is not enough

@piaskowyk
Copy link

piaskowyk commented May 7, 2021

Hey @Kudo
I have tried to add support for V8 runtime in Reanimated, but I found an issue. When I call a function with callWithThis() this doesn't set jsThis property. This happens exactly in this line: https://github.com/software-mansion/react-native-reanimated/blob/%40piaskowyk/flipper/Common/cpp/SharedItems/MutableValue.cpp#L46
This code works on Hermes and JSC without problems.
Maybe you know a quick answer or suggest why? If not I can try to debug it and provide more information.

@mkilburn60
Copy link

@piaskowyk now that callWithThis is fixed is there a possibility to get Reanimated working with V8?

@Kudo
Copy link
Owner

Kudo commented Oct 11, 2021

before reanimated support building from source, i had forked reanimated and add v8 support in Kudo/react-native-reanimated@4b06995

to those you would like to try react-native-v8 + reanimated, here is a one step how:
yarn add react-native-reanimated@npm:react-native-reanimated-v8@2.2.2

@egueiros
Copy link

egueiros commented Nov 4, 2021

@Kudo I'm getting this error when trying to build for Android:
Transform's input file does not exist: /Users/.../node_modules/react-native-reanimated/android/react-native-reanimated-66-v8.aar. (See https://issuetracker.google.com/issues/158753935)

What did I miss? Thank you!

@egueiros
Copy link

egueiros commented Nov 5, 2021

@Kudo I'm getting this error when trying to build for Android: Transform's input file does not exist: /Users/.../node_modules/react-native-reanimated/android/react-native-reanimated-66-v8.aar. (See https://issuetracker.google.com/issues/158753935)

What did I miss? Thank you!

Oh, I think it's because I'm using RN 0.66.1 🤦‍♂️ I see 64-v8.aar and 65-v8.aar.

@samjayhk
Copy link

@Kudo Could you help to add 0.66 support? Thanks!

@gpbaculio
Copy link

This simple animation crashes on Android Animated.View :(

 const goesDown = useSharedValue(false);

  const progress = useSharedValue(0);

  useEffect(() => {
    progress.value = withRepeat(
      withTiming(1, { duration: 1000 }, () => {
        goesDown.value = !goesDown.value;
      }),
      -1,
      true,
    );
  }, []);
  const smallCircle = useAnimatedStyle(() => {
    // const width =  Pixel(24)
    // const top = Pixel(1)
    'worklet';
    const scale = interpolate(progress.value, [0, 1], [0, 1]);
    return {
      transform: [{ scale }],
      height: 30,
      width: 30,
      backgroundColor: 'red',
      borderColor: 'green',
      borderRadius: 15,
      borderWidth: 1,
      alignSelf: 'center',
      position: 'relative',
      top: 10,
    };
  });

@Kudo
Copy link
Owner

Kudo commented Apr 8, 2022

@gpbaculio could you help to try the new approach for v8 + reanimated? it's not merged from reanimated but you can still preview by installing the node package from github. i use the new approach with your example code, it works for me 🤔

@gpbaculio
Copy link

@Kudo seems the new approach works on the sample, but trying to add it on my current project does not. I get this error:

was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/glendonphilippbaculio/Desktop/marketplace-app/node_modules/react-native-reanimated/lib/Animated.js. Indeed, none of these files exist

it works if i import like "react-native-reanimated/src/Animated"

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

No branches or pull requests

8 participants