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

Easing in Keyframe causes fatal crash on Android #4034

Closed
AdamGerthel opened this issue Feb 6, 2023 · 9 comments
Closed

Easing in Keyframe causes fatal crash on Android #4034

AdamGerthel opened this issue Feb 6, 2023 · 9 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 Wait for reply

Comments

@AdamGerthel
Copy link

AdamGerthel commented Feb 6, 2023

Description

When using custom easings (i.e. non-default) on keyframe animations, the application crashes with the following error:

JS Functions are not convertible to dynamic

Error: JS Functions are not convertible to dynamic
at workletValueSetter (/node_modules/react-native-reanimated/src/reanimated2/core.ts
at workletValueSetter
at startAnimationForTag

Steps to reproduce

Create an Animated.View with an entering Keyframe sequence that uses Easing.ease and have it render. The same problem occurs with other easings such as Easing.out(Easing.exp) but not with Easing.out(Easing.quad) or Easing.in(Easing.quad).

Snack or a link to a repository

https://snack.expo.dev/@insats/bug---reanimated-easing-in-keyframe-android

Reanimated version

2.14.4 in my project and 2.9.1 in the snack sample. Same problem in both.

React Native version

0.68.1 in my project and Expo v46 (0.69.5) in the snack sample.

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

Paper (Old Architecture)

Build type

None

Device

Real device

Device model

No response

Acknowledgements

Yes

@AdamGerthel AdamGerthel added the Needs review Issue is ready to be reviewed by a maintainer label Feb 6, 2023
@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 Feb 6, 2023
@graszka22
Copy link
Member

Your Snack link doesn't work (oh no something ate it 🤣).

Screenshot 2023-02-06 at 18 23 58

I tried to reproduce it like this: https://snack.expo.dev/wty2brqIH?platform=android with Easing.out(Easing.exp) but it works on my Android. Could you upload your snack again (and check if it works)?

@graszka22 graszka22 added Wait for reply and removed Repro provided A reproduction with a snippet of code, snack or repo is provided labels Feb 6, 2023
@AdamGerthel
Copy link
Author

AdamGerthel commented Feb 6, 2023

@graszka22 there was a type in the URL. Try it now!

Update
Yours doesn't work either, when using Easing.ease: https://snack.expo.dev/@insats/fascinated-mixed-nuts?platform=android

@graszka22
Copy link
Member

Ok, I can reproduce it 👍 But I've tried also running on the main branch of reanimated and it seems to work, no crashes, the dot is moving. Can you try it too?

@graszka22 graszka22 added the Repro provided A reproduction with a snippet of code, snack or repo is provided label Feb 6, 2023
@AdamGerthel
Copy link
Author

AdamGerthel commented Feb 7, 2023

@graszka22 I haven't been able to build my project for Android using reanimated v3, but I tried it with a fresh RN project and it works there. That definitely narrows it down, right?

EDIT: Also, is v3 compatible with RN 0.68.1? I'm trying to decide if I should refactor my animations to use useAnimatedStyle instead of layout animations or attempt an upgrade, while waiting for this issue to be resolved. Upgrading RN is not an option for me right now.

@graszka22
Copy link
Member

If it works with v3 then I assume the issue is fixed?

@AdamGerthel
Copy link
Author

@graszka22 Well, it still needs to be fixed for v2 if v2 is still maintained, right?

@graszka22
Copy link
Member

We're ending maintenance for v2. We're planning only support for RN 72 and simple fixes. This is probably not a simple fix.
I'm suspecting this issue is solved by recent shareable values rewrite.
v3 is compatible with RN 0.68.1 on Paper architecture. You shouldn't have to change anything in your project to upgrade reanimated v2 to v3, unless you use reanimated v1 api.

@AdamGerthel
Copy link
Author

I manage to build it on Android now with v3, after fixing this and removing this. Seems to be working well.

@graszka22
Copy link
Member

Great 👏 if all seems to be working, I'm closing the issue.

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 Wait for reply
Projects
None yet
Development

No branches or pull requests

2 participants