react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Build error on initial app RN 0.67.2

Open Omelyan opened this issue 3 years ago • 6 comments

Description

There's an error while simplest npx init for current RN version 0.67.2, and everything was fine for RN 0.64.2...

ERROR: 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

Actual behavior & steps to reproduce

  1. npx react-native init test (current latest RN version is 0.67.2)
  2. install Reanimated...
  3. replace App.js by:
import {View} from 'react-native';

import Animated from 'react-native-reanimated';

const App = () => (
  <View style={{height: 100, aspectRatio: 1, backgroundColor: 'tomato'}} />
);

export default App;
  1. npx react-native run-android and you'll get the error above.

Snack or minimal code example

Just create an app by calling npx react-native test, install Reanimated, import Reanimated lib from App.js and try to run...

Package versions

"react": "17.0.2", "react-native": "0.67.2", "react-native-reanimated": "^2.3.1"

Affected platforms

  • [x ] Android
  • [ ] iOS
  • [ ] Web

Omelyan avatar Feb 02 '22 18:02 Omelyan

fuck It seems that I have also this error in one of my projects

Update: I fixed it somehow by adding the reanimated bable plugin & after that I completely rebuilt the app + npx react-native start --reset-cache

milan2sky avatar Feb 05 '22 10:02 milan2sky

RN 0.67.2 -> 0.66 or older. it worked

gk37497 avatar Feb 07 '22 06:02 gk37497

RN 0.67.2 -> 0.66 or older. it worked

works for me.. thanks @gk37497

rjuevesano avatar Feb 16 '22 13:02 rjuevesano

Hurts my heart when the fix is downgrading. 💔

itsmelion avatar Mar 17 '22 09:03 itsmelion

I fixed the issue with these commands :

Android

Cmaker error 

- open android folder with android studio 
- top menu bar 
- tools -> sdks
- sdk tools
- show more info or sdks details checkmark
- check CMAKER 3.18 and 3.22
- install those 
- cd android && rm -R .gradle && cd app && rm -R build && cd ..

iOS

- babel.config.js

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


- clean cache completely

watchman watch-del-all 
rm -rf $TMPDIR/react-native-packager-cache-* 
rm -rf $TMPDIR/metro-bundler-cache-* 
rm -rf node_modules/ 
npm cache clean --force 
npm install
npm start -- --reset-cache
npm run ios -- --reset-cache

1mehdifaraji avatar Aug 25 '22 16:08 1mehdifaraji

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Aug 25 '22 16:08 github-actions[bot]