First off, I don\'t know react, but I figured deploying to an iOS device instead of the simulator wouldn\'t be too difficult to do with the docs. They were a bit sparse but
Your problem shouldn't have anything to do with the console, if you properly bundled your javascript into the ios app it wont be trying to talk to dev server, it'll just get the javascript from the bundle.
From the error message I'd guess that you might have renamed your main component. Be sure that the 'AppName'
you pass into the
AppRegistry.registerComponent('AppName' /* <- */, ... )
matches with the @"AppName"
on your AppDelegate.m
on the call for
[[RCTRootView alloc] initWithBundleUrl:...
moduleName:@"AppName" // <-
launchOptions:...
It is because the react-native server is still watching the old one. You need to shut the server down first.
You could just kill the process.
In terminal
ps aux | grep react
Kill or pkill the process and then
npm start
Got the same error, restarting everything including the xcode and terminal worked for me.
I got the similar message in the console.
message: Invariant Violation: Application AwesomeProject has not been registered."
I just added REACT_EDITOR=atom
on ~/.bashrc file.
I got this issue after renaming the project name and a couple of files. to solve it just make sure that the name of the app is the same in index.js app.json, MainActivity.java and AppDelegate.m.
app.json
{ "name": "MyNewApp", "displayName": "MyNewApp" }
index.js
AppRegistry.registerComponent('MyNewApp', () => MyNewApp);
MainActivity.java
`@Override protected String getMainComponentName() {
return "MyNewApp"; }
AppRegistry defines the entry point to the application and provides the root component.
Your first param doesn't match your project name.
AppRegistry.registerComponent('AwesomeProject', () => YourMainComponent);
First param of registerComponent
has to be your project name, second param is anonymous function that returns your root react component.
If first param doesn't match xcode project name, you get that error that your application has not been registered.
In case you don't have AppRegistry in the scope you can call it like this
React.AppRegistry.registerComponent
or you can assign it to the AppRegistry
var
var {
AppRegistry
} = React;