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

Animated node with ID 2 already exists #1781

Closed
TijsM opened this issue Mar 3, 2021 · 5 comments
Closed

Animated node with ID 2 already exists #1781

TijsM opened this issue Mar 3, 2021 · 5 comments

Comments

@TijsM
Copy link

TijsM commented Mar 3, 2021

Description

When installing and using Reanimated v2 I keep on getting the Animated node with ID 2 already exists error.
This only happens on Android though.

(I'm not using pure reanimated but i'm using Moti, which relies on Reanimated V2)

I found that people had similar issues because they had a dependency that used Reanimated V1 (~1.13.0), for this is the case as well, but I can't figure out a way to work around this

Screenshots

Package versions

  • React: 16.13.1
  • React Native: ~0.63.2
  • React Native Reanimated: 2.0.0-rc.0
  • NodeJS: 12.16.1
@TijsM TijsM added the Bug label Mar 3, 2021
@github-actions
Copy link

github-actions bot commented Mar 3, 2021

Issue validator

The issue is invalid!

  • Section required but not found: steps to reproduce(for label 🐞 bug)
  • Section required but not found: expected behavior(for label 🐞 bug)
  • Section required but not found: actual behavior(for label 🐞 bug)

@kmagiera
Copy link
Member

kmagiera commented Mar 4, 2021

Have you tried putting Reanimated v2 in the resolutions section such that it enforces use of v2 across all the modules which depend on Reanimated? Version 2 of reanimated contains all the methods from v1 so the code written for v1 is expected to work.
https://classic.yarnpkg.com/en/docs/selective-version-resolutions/#toc-how-to-use-it

@jakub-gonet
Copy link
Member

As kmagiera mentioned you should try using the resolutions section to make sure that one version will be used. For more context: when you have multiple versions of Reanimated they still share one native module but they're executing independently so at some point they'll use the same id, crashing the native module.

This issue is a bit old. If you still experience this problem, please reply.

@IjzerenHein
Copy link

Depending on the version of Moti that you are using, Moti used to declare react-native-reanimated as a (dev-)dependency, which may have caused problems (and required a resolution to fix). This is no longer the case with the latest version of moti, and you need to explicitly add react-native-reanimated to your dependencies. We also had problems with Snack in that regard. Hope that helps.

@letehaha
Copy link

Have you tried putting Reanimated v2 in the resolutions section such that it enforces use of v2 across all the modules which depend on Reanimated? Version 2 of reanimated contains all the methods from v1 so the code written for v1 is expected to work. https://classic.yarnpkg.com/en/docs/selective-version-resolutions/#toc-how-to-use-it

Just faced the same problem with react-native-skeleton-content which used version 2.1.0 and Expo which required version 2.14.4, and dependency resolution helped 👍

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

5 participants