software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.84k stars 1.29k forks source link

TurboModuleRegistry NativeReanimated error #1127

Closed Eli-Nathan closed 4 years ago

Eli-Nathan commented 4 years ago

Description

Using this package along with React Native Reanimated Bottom Sheet, I get this error on Android. (ios works great!)

Dismissing the error on my android emulator results in a blank white screen.

client_log | Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

[3] cllient_log | Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication), js engine: hermes
Screen Shot 2020-08-15 at 1 14 37 PM

Screenshots

Steps To Reproduce

  1. Install and link Reanimated v2
  2. Install React native Bottom Sheet Lib (Uses reanimated v2)
  3. Add any components that have a Reanimated v2 dependency

Expected behavior

App is usable

Actual behavior

App fails with the above error

Package versions

JeffPatricio commented 3 years ago

Hello, I was able to solve it by following the installation steps:

https://docs.swmansion.com/react-native-reanimated/docs/installation/

The problem is that I went to the automatic as usual to use react navigation and I had not performed these steps.

then I ran the following command:

cd android && ./gradlew clean && cd .. && npx react-native run-android

hungnq139 commented 3 years ago

@Skr1pt1k use newest flipper : Podfile : use_flipper!({ 'Flipper' => '0.79.1' })

ithustle commented 3 years ago

+1 on Android Version: 2.0.0

Downgrade to 1.13.2 solved the problem, unfortnutely

TrebuhD commented 3 years ago

Updating the flipper plugin like @hungnq139 suggested seems to have fixed this for me.

aditigupta7 commented 3 years ago

install react-native-reanimated library step by step from https://docs.swmansion.com/react-native-reanimated/docs/installation/

I have resolved this problem through this.

aditigupta7 commented 3 years ago

If you downgraded your library then it might give you other errors and issues so it will be better to install react-native-reanimated library through steps given in https://docs.swmansion.com/react-native-reanimated/docs/installation/ I read all the instructions and followed it. Hope it will help you all too.

aditigupta7 commented 3 years ago

Install react-native-reanimated by following steps in https://docs.swmansion.com/react-native-reanimated/docs/installation/

I resolved my problem through this.

RaghavShubham commented 3 years ago

I'm getting the same error in expo

saurabh874 commented 3 years ago

I'm getting the same error.

zhigang1992 commented 3 years ago

If it's happening for you on iOS, and you have a special RN setup (maybe with existing swift / objc projects)

Make sure your RNBridge's delegate is a UIResponser and not just a NSObject.

If you look for DONT_AUTOINSTALL_REANIMATED flag,

You'd find that it's extending only UIResponder, which would be fine in most cases, since by default RN uses AppDelegate for Bridge delegate.

But if you are like us, and put the react native code in its own NSObject class, this might be something to watch out for.

p2mittal-dev commented 3 years ago

Error Solved

Step 1 - Download react native project from github "https://github.com/software-mansion-labs/reanimated-2-playground". Step 2- npm install react-native start react-native run-android and build app Step 3- when its work move your required project files and install your required npm pakages. Step 4 - npm cache clean --force cd android gradlew clean gradle cleanBuildCache gradlew build --refresh-dependencies cd.. npx react-native start --reset-cache npx react-native run-android its work for me try once.

Alecefe commented 3 years ago

Solved downgrading react-native-reanimated to v1.13.2. The v2 of the package evenly crashes the app.

ductridev commented 3 years ago

Package error ? i got same problem, hope it will be fixed soon

iamamanprajapati commented 3 years ago

@trisknightgamer It is not a permanent solution bro

ductridev commented 3 years ago

@TrisKnightGamer It is not a permanent solution bro

Package problem right ? I need a real reason to tell my client

ductridev commented 3 years ago

Solved downgrading react-native-reanimated to v1.13.2. The v2 of the package evenly crashes the app.

This solution help me, thank you.

thabata-marchi commented 3 years ago

Is there any previous version that we can use until we resolve this error? Last year in the alpha version did not give this error.

ductridev commented 3 years ago

@thabata-marchi use v1.13.2, i get no error with this version.

thabata-marchi commented 3 years ago

I need this animation to work: https://www.youtube.com/watch?v=6uixYHh7XEc In Reanimated 1 you can't do this animation, In Reanimated 1 you can't do this animation, because it works in UI thread only.

Honeyzed commented 3 years ago

go
to this Path android/app/build.gradle fix the : project.ext.react = [ enableHermes: true // <- here | clean and rebuild if changing ] MainApplication.java

fix the : import com.facebook.react.bridge.JSIModulePackage; // <- add import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add

@Override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); // <- add }

Add Reanimated's babel plugin to your babel.config.js:

fix : plugins: [ ... 'react-native-reanimated/plugin', ], this step used .......solve the this problem TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. thanku

SarvaDev-123 commented 3 years ago

Error Solved

Step 1 - Download react native project from github "https://github.com/software-mansion-labs/reanimated-2-playground". Step 2- npm install react-native start react-native run-android and build app Step 3- when its work move your required project files and install your required npm pakages. Step 4 - npm cache clean --force cd android gradlew clean gradle cleanBuildCache gradlew build --refresh-dependencies cd.. npx react-native start --reset-cache npx react-native run-android its work for me try once.

@p2mittal-dev It resolved when you cloning the reanimated-2-playground project. But I want how to install it another project without cloning .?

ductridev commented 3 years ago

go to this Path android/app/build.gradle fix the : project.ext.react = [ enableHermes: true // <- here | clean and rebuild if changing ] MainApplication.java

fix the : import com.facebook.react.bridge.JSIModulePackage; // <- add import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add

@override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); // <- add }

Add Reanimated's babel plugin to your babel.config.js:

fix : plugins: [ ... 'react-native-reanimated/plugin', ], this step used .......solve the this problem TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. thanku

it don't fix the error, i downgraded to 1.13.2 and it works

ductridev commented 3 years ago

@SarvaDev-123 try downgraded to 1.13.2

SarvaDev-123 commented 3 years ago

@TrisknightGamer @p2mittal-dev How to downgraded to 1.13.2 could you provide any command and animation works on (react-native-collapsible-tab-view) I am using this liberary .

ductridev commented 3 years ago

@SarvaDev-123 delete node_modules and package_lock.json then open terminal, enter this : npm i react-native-reanimated@1.13.2

SarvaDev-123 commented 3 years ago

@TrisKnightGamer when i add plugins: [ ...'react-native-reanimated/plugin', ], then run node modules then it through error like this "index.js: Cannot find module 'babel-plugin-r' "

ductridev commented 3 years ago

@TrisKnightGamer when i add plugins: [ ...'react-native-reanimated/plugin', ], then run node modules then it through error like this "index.js: Cannot find module 'babel-plugin-r' "

@SarvaDev-123 you don't need to add anything, only downgrade to 1.13.2

Dakuan commented 3 years ago

this has cropped up again having previously been solved, even with instruction steps followed, broken on ioS simulators

ductridev commented 3 years ago

@Dakuan you have tried to install react-native-reanimated with version 1.13.2, correct ?

piaskowyk commented 3 years ago

We got rid of TurboModuleRegistry.getEnforcing() in version 2.0.1, so I think that upgrade could help. Let me know if it works.

siddharthJadhav commented 3 years ago

I am also having the same issue. Did anyone found the solution?

waheedakhtar694 commented 3 years ago

I am getting this issue on ios with react-native-reanimated v2.10

skeie commented 3 years ago

Updating to 2.2.0 worked for me

hieunguyen-groove commented 3 years ago

Upgrading to v2.0.1 worked for me.

enlightenedpie commented 3 years ago
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

This says that TurboModuleRegistry cannot find our turbo module. This can be coming from the wrong configuration of Reanimated or using a debugger. Debugging RN works by running JS in the browser (v8 engine) and making remote calls via bridge to the native side. Turbomodules work by sharing JS engine context on the native side, so when you run JS in the other engine it loses that context. Note that this is a limitation coming from RN and not Reanimated. This comment may give some more insight into that.

If disabling debugger fixes your problem then it works like intended. If not, please create a repro repository to allow us to investigate this issue.

This was the fix for me. Running the debugger (from the RN debug menu) was breaking my app. I turned off the debugger and now the app builds perfectly.

datvp09 commented 3 years ago

For me I did exactly these steps to make it run again:

  1. npm i react-native-reanimated
  2. npx pod-install
  3. on developer menu, press Debug with Chrome
  4. press Turn off debugging
  5. delete app
  6. Build again using Xcode or react-native run-ios

Look like the reason is Reanimated doesn't work with debugger, it only works with Flipper for now

AhmedrAshraf commented 3 years ago

Solved downgrading react-native-reanimated to v1.13.2