React-Native: Module Appregistry Is Not a Registered Callable Module

Module AppRegistry is not registered callable module (calling runApplication)

I was using native base for my app here is link native base

and you can see there is no app registry like this

 AppRegistry.registerComponent('Point', () => Point) 

but i have to do this to run my app

React-Native: Module AppRegistry is not a registered callable module

i just upgraded to react-native 0.18.1 today tough having some peer dependencies issues with 0.19.0-rc pre-release version.

Back to your question, what I did was

  1. cd android
  2. sudo ./gradlew clean (more information about how clean works here)

then back to the working directory and run
react-native run-android

you should restart your npm too after that upgrade.

hope this works for you.

Invariant Violation: Module `AppRegistry` is not a registered callable module (calling `runApplication`). and etc

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"
]

};

React Native - Module AppRegistry is not a registered callable module

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;

react navigation drawer giving me Invariant Violation: Module AppRegistry is not a registered callable module

So~ this happened because of not properly installing react-native-reanimated(very common reason for the invariant Violation: Module AppRegistry is not a registered callable module),

to solve this issue just follow the documentation on the react-native-reanimated website
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

step 1:
in babel.config.js

    module.exports = {
...
plugins: [
...
'react-native-reanimated/plugin',//Add this
],
};

step 2:
in android/app/build.gradle

project.ext.react = [
enableHermes: true // <-change this to true
]

step 3 : in MainApplication.java

  import com.facebook.react.bridge.JSIModulePackage; // <- add
import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add
...
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
...

@Override
protected String getJSMainModuleName() {
return "index";
}

///////////////////////////////////////////////////
@Override
protected JSIModulePackage getJSIModulePackage() { <- add this block
return new ReanimatedJSIModulePackage(); //
}
///////////////////////////////////////////////////
};

step 4 : in terminal

cd android 
./gradlew clean
cd ../

step 5 : just to be safe

npx react-native run-android -- --reset-cache   


Related Topics



Leave a reply



Submit