React Native - Module AppRegistry is not a registered callable module

Viewed 664

I get error Module AppRegistry is not a registered callable module whenever I upgrade above react-native 0.61.5. Once I downgrade back to 0.61.5 it works fine again.

UPDATE 11/14/20 I tried the answer killall -9 node but I get the error bash: killall: command not found. This is likely a very rookie mistake where I need to install something or run command from different path

UPDATE 12/28/20 - in response to @dhruv soni.....below is my index.js file where AppRegistry.registerComponent is called:

UPDATE 01/23/21 - I used "React Native Upgrade Helper" to upgrade...triple checked everything is correct. Issue only occurs on Android (not IOS)....but it builds fine on Android Studio...error only occurs with react-native run-android. I use very many 3rd party libraries so Im guessing its related to that

4 Answers

Fixed the issue on my end by double checking that i modified all the files correctly during my RN upgrade, then running watchman watch-del-all, and react-native start --reset-cache. Then on android, build -> clean. then it worked! sigh

Specific solution of your question

I found a wrong initialization of appContainer. you can fix as below

const AppContainer = createAppContainer(SignedInTabNav);

class App extends React.Component {
  render() {
    return <AppContainer />;
  }
}

export default App;

I can be wrong but in my case, this happens every time whenever I install new npm package and maybe not sure but I face this only with iOS, so each time whenever I face this issue I follow these steps.

  • killall -9 node
  • delete package-lock.json
  • delete node_module folder
  • delete pods folder
  • delete pod-lock file.
  • npm i
  • npm pod-install ios
  • npm start --reset-cache
  • react-native run-ios

Kill all node process and start the server and run the application

  • Run command killall node
  • Run taskkill /f /im node.exe if the process still persists
  • Run command yarn start --reset-cache
  • Run command react-native run-ios OR react-native run-android

I see now why noone could answer this....

I had to comment out nearly all code in my app...piece by piece until the error stopped occuring. The naughty line of code was import {GiftedChat, Bubble} from 'react-native-gifted-chat'

Seems there is some kind of conflict between my upgraded version of RN and RNGiftedChat

"react-native": "0.63.3",
"react-native-gifted-chat": "^0.16.3",

Can "fix" bug by either:

  1. downgrade RN or
  2. Remove/replace react-native-gifted-chat.
    .....however dont really want to do either.

...not really sure where to go from here

Related