3

I am making a project using react-native, when I added drawer navigation it started giving me an error as:

Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

so when I search for the solution I came across this answer https://github.com/software-mansion/react-native-reanimated/issues/846#issuecomment-943267584 - But when I followed the procedure as given in this link it started giving me two error - Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?, js engine: hermes and also the above error. I am using react-native 0.67. please help if you can.

Meisan Saba
  • 800
  • 2
  • 9
  • 25
MOHAMMAD SIDDIQUE
  • 223
  • 2
  • 5
  • 17

3 Answers3

4

try to add this line in your babel.config.js file; Then run again, may be helps you

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
      "react-native-reanimated/plugin"
    ]

};
Dhanesh M
  • 136
  • 3
  • It worked, but now it is giving a warning as "[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!" so is there any way to resolve this – MOHAMMAD SIDDIQUE Feb 22 '22 at 05:48
  • https://stackoverflow.com/questions/70756058/react-native-react-native-gesture-handler-seems-like-using-an-old-api-after-ya – Dhanesh M Feb 22 '22 at 06:02
  • after adding above lines it shows error: index.js: Cannot find module 'react-native-reanimated/plugin' – Vaishnavi Maske Feb 18 '23 at 08:33
0

After adding the react-native-reanimated to your project

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

  module. Exports = {
    presets: [
      ...
     ],
    plugins: [
     ...
    'react-native-reanimated/plugin',
    ],
   };
  • yarn start --reset-cache
  • npm start -- --reset-cache
  • expo start -c
Deepak Singh
  • 749
  • 4
  • 16
0

for me, it seems that the new react native version 0.70 is not compatible with react native navigation package, after removing the navigation package, and clearing the cache the code works!

yarn remove @react-native-navigation

yarn start --reset-cache