React-Native: Application Has Not Been Registered Error

React-Native: Application has not been registered error

I guess it is an error caused by not matching name of project and your registered component.

You have inited project with one name, i.e.

react-native init AwesomeApp

But in your index.ios.js file you register other component

AppRegistry.registerComponent('Bananas', () => Bananas);

When it must be

AppRegistry.registerComponent('AwesomeApp', () => Bananas);

If your component name does match, ensure you don't have any other react-native/node process running in another terminal.

Invariant Violation: "main" has not been registered While running react-native app

The meaningful exception that you are seeing here is:

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider

The "main" has not been registered is a red herring, it only happened because the other error.

The RNCSafeAreaProvider exception is happening because you have multiple copies of react-native-safe-area-context in your app. You may be using a library that includes it as a dependency in addition to having it installed in your app. If you use yarn, you can run yarn why react-native-safe-area-context to see where it's coming from. Try running expo install react-native-safe-area-context and if that doesn't help you can use yarn resolutions to override the version used by the package that depends on it.

Application main has not been registered

The following solution worked:

AppRegistry.registerComponent('main',() => App);

Credits: Rishav Kumar

(Cannot you people just reply to mark as solve ?)

Invariant violation: "tesApp" has not been registered

Please destroy your metro bundler and try to run your app again it will work.



Related Topics



Leave a reply



Submit