question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing createDrawerNavigator throws 'NativeReanimated' error.

See original GitHub issue

Description

After following the installation instructions for React Navigation and then Drawer Navigation, I am getting a NativeReanimated error.

I have reanimated in both my package-lock.json:

"react-native-reanimated": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.0.0.tgz",
      "integrity": "sha512-kIrdBoXSky7DQ62SOgosgimKM+Lt+SzAaM+ovVpCLBcwUK2aYRfLxa9ffgvKjeH9/n7dONlwEMjbKssGkuyq2Q==",
      "requires": {
        "@babel/plugin-transform-object-assign": "^7.10.4",
        "fbjs": "^3.0.0",
        "mockdate": "^3.0.2",
        "string-hash-64": "^1.0.3"
      }

and in my package.json:

"dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/drawer": "^5.12.4",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-reanimated": "^2.0.0",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.18.1"
  }

It was installed vis the React Navigation instructions as follows: npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view

This is the error I’m receiving in Metro and node after running npx react-native run-android: [Sat Mar 06 2021 10:25:12.380] BUNDLE ./index.js

[Sat Mar 06 2021 10:25:15.192] ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(…): ‘NativeReanimated’ could not be found. Verify that a module by this name is registered in the native binary. [Sat Mar 06 2021 10:25:15.196] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) [Sat Mar 06 2021 10:25:15.196] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

In the emulator I’m just receiving a blank white screen.

Screenshots

image image image

Steps To Reproduce

  1. Try to run the app via: npx react-native run-android

Expected behavior

The app should run.

Actual behavior

I get a blank white screen.

Snack or minimal code example

Commenting out this line: import { createDrawerNavigator } from ‘@react-navigation/drawer’; fixes the error.

image

Package versions

Windows 10 Visual Studio Code

"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/drawer": "^5.12.4",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.18.1"
  • NodeJS: v10.19.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:21

github_iconTop GitHub Comments

9reactions
raajnadarcommented, Mar 11, 2021

run npx react-native start --reset-cache after that npx react-native run-android or npx react-native run-ios

4reactions
YunusEmreNalbantcommented, Mar 11, 2021

run npx react-native start --reset-cache after that npx react-native run-android or npx react-native run-ios

thank yo bro… I almost went crazy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am trying to use the @react-navigation/drawer but it was not ...
I was getting the same error. Upgrading the react-native-reanimated version to react-native-reanimated@2.2.0 solved my issue.
Read more >
react native reanimated error - You.com | The search engine you ...
React Native Reanimated error: Execution failed for task ... import { createDrawerNavigator } from '@react-navigation/drawer'; import { NavigationContainer } ...
Read more >
Drawer Navigator | React Navigation
npx expo install react-native-gesture-handler react-native-reanimated ... import { createDrawerNavigator } from '@react-navigation/drawer';
Read more >
Reanimated - Expo Documentation
Reanimated. react-native-reanimated provides an API that greatly simplifies the process of creating smooth, powerful, and maintainable animations.
Read more >
how to fix error when using the React Navigation?-babel.js
import React, { Component } from 'react' import { createDrawerNavigator } from ... react-native-reanimated react-native-gesture-handler react-native-screens ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found