react-native-reanimated: TurboModuleRegistry NativeReanimated error

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

  • React: 16.13.1
  • React Native: 0.63.2
  • React Native Reanimated: 2.0.0-alpha.5
  • React Native Reanimated Bottom Sheet: ^1.0.0-alpha.22

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 17
  • Comments: 87 (7 by maintainers)

Most upvoted comments

When loading with 2.0.0-alpha.8 I’m still running into ExceptionsManager.js:179 Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.

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

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

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

Same here with alpha8 when trying to start the debugger

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.

I hope this is helpful and I’m not stating the obvious to everyone here:

The current (rc.2) docs specify that RN’s remote debugging will not work alongside JSI.

For people looking to keep using Reanimated V2 and continue logging to a console, the current solution is to use Flipper to connect to the device instead of enabling the in-browser remote debugger. It’s already part of react-native on the device, so all you’re missing is to run the desktop application to receive the app’s logs:

https://fbflipper.com/

still happening, 2.0.0-rc.1, xcode 12.3

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

I get this when I Shake Device -> Debug the app.

Did you enable TurboModules on Android as it explained in the installation guide?

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.

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.

Getting the same when trying to enable remote debugger. IOS, alpha-8, RN 62.0

I’m having this problem. It’s unfortunate.

2.0.0-rc.2, xcode 12.3, RN-0.63.4

Please stick to this version "react-native-reanimated": "2.0.0-alpha.6",. I had the same issue, so make sure you have 2.0.0-alpha.6 and implemented the following instructions https://docs.swmansion.com/react-native-reanimated/docs/2.0.0-alpha.7/installation/#ios

P.S.: Notice #import <RNReanimated/REATurboModuleProvider.h>, REATurboModuleProvider is renamed from RETurboModuleProvider (this module is used somewhere in the code it needs rename as well) and it seems that this file is not available in the newer version of reanimated.

Have the same issue with: Xcode: 12.0.1 RN: 0.63.3 react-native-reanimated: 2.0.0-alpha.8

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.

More developments: I downloaded the playground application, fired it up, everything worked well. I turned on debugging and now I’m seeing the error.

So, I turned debugging off on my app and we’re back in business. This occurs in both iOS and Android for me. So it appears to be something with having the debugger enabled that is causing the issue.

Digging in further, it looks like when we are externally debugging global.__reanimatedModuleProxy is undefined so then we go to ask for the module from the TurboModuleRegistry.getEnforcing() method, which bombs out in both scenarios. When not attached to the debugger global.__reanimatedModuleProxy is set.

I’m using the latest production version of Chrome - 86.0.4240.193

I just had the same issue. Also wondering why this issue is closed.

Thanks for the tip. I do have 1.13.1 working again after adding that to my all-in-one reset command: watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start --reset-cache Followed by running the sim again: yarn react-native run-ios --simulator 'iPad Air 2'

I’ll test upgrading in a similar way next.

I’m looking at the UIResponder+Reanimated.mm code and started stepping through. What’s interesting to me is that when I am not attached to the debugger, the code runs. When I switch to attaching to the debugger, it doesn’t run. Then when I switch back, it runs again.

i had the same error.

Solution: uninstalled current version for: @react-navigation/drawer @react-navigation/native @react-navigation/stack

then installed: “@react-navigation/drawer”: “^5.12.3”, “@react-navigation/native”: “^5.9.2”, “@react-navigation/stack”: “^5.14.2”,

this fixed the error

Check Hermes engine is enabled and add some codes for RNA v2. https://docs.swmansion.com/react-native-reanimated/docs/installation/

Same issue here:

TurboModuleRegistry.getEnforcing(…): ‘NativeReanimated’ could not be found. Verify that a module by this name is registered in the native binary.

xcode: 12.1 DevTools 4.10.1-3a8c04e3b2

“dependencies”: { “@react-native-async-storage/async-storage”: “^1.13.3”, “expo”: “~40.0.0”, “expo-status-bar”: “~1.0.3”, “react”: “16.13.1”, “react-dom”: “16.13.1”, “react-native”: “https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz”, “react-native-reanimated”: “2.0.0-rc.0”, “react-native-web”: “~0.13.12” }, “devDependencies”: { “@babel/core”: “~7.9.0”, “babel-preset-expo”: “8.3.0” },

I would rather suggest to just disable the code which uses Reanimated instead

That’s the issue I’m running into as well. In my comments above, I detailed what I think is the reason, which is that the module registration mechanism the library is using in alpha.8 has a flaw in it. That flaw being, it doesn’t work when the debugger is connected. I am unfamiliar with react-native’s underlying native code registration mechanisms, especially with the new JSI system that Reanimated2 uses, but I stepped through the code yesterday and that was my conclusion. I’m just waiting on comments from the maintainers on if that’s the case and if there is anything that can be done to patch it before a new version is release.

In the meantime, I have resorted to turning my debugging off and have resorted to print statements. Not optimal, and not a long term strategy, but it is allowing me to proceed.

@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

I’m getting the same error in expo

+1 on Android Version: 2.0.0

Downgrade to 1.13.2 solved the problem, unfortnutely

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

Same here. The issue arise when I’m in debug mode with expo. And if the app is in debug mode, the only way to revert it is to reinstall the expo app because the menu to disable the debug mode is not available when there is an error.

I do have the same problem. I had the “react-native-reanimated”: “^2.0.0-alpha.9.2” version. I did reinstalled the version “react-native-reanimated”: “^2.0.0-alpha.6”. Flush the node_modules and the package-lock.json. Rebuild the app. And I still get the same error.

It seems like a solid lead, thank you for investigating. That’s the issue that lead me here in the beginning. I’m trying alpha.6.1 now but if I’m stuck there I’ll have to wait it out.

Edit: Using 6.1 and following the turbo install instructions is working for me.