react-native-reanimated
react-native-reanimated copied to clipboard
Build error on initial app RN 0.67.2
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
- npx react-native init test (current latest RN version is 0.67.2)
- install Reanimated...
- 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;
- 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
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
RN 0.67.2 -> 0.66 or older. it worked
RN 0.67.2 -> 0.66 or older. it worked
works for me.. thanks @gk37497
Hurts my heart when the fix is downgrading. 💔
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
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?