spencercarli / react-native-meteor-boilerplate

MIT License
628 stars 139 forks source link

RNApp has not been registered, possibly due to require() #46

Closed hoolymama closed 8 years ago

hoolymama commented 8 years ago

Hi, I installed the boilerplate project as per your instructions and when I try to run in an iOS simulator I get a red screen with errors below:

Application RNApp has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.

runApplication
AppRegistry.js:92

__callFunction
MessageQueue.js:204

<unknown>
MessageQueue.js:95

guard
MessageQueue.js:41

callDFunctionReturnFlushedQueue
MessageQueue.js:94

I also created the AwesomeProject from the React-Native site and that seems to work fine.

I then tried to replace the contents of index.ios.js with those from AwesomeProject (so it doesn't try to import anything from ./app), but still the same error.

NOTE: When I was installing with NPM I was getting errors about eslint, so I took all that out of the package.json.

I have node 4.4.7 installed. I did start Meteor first and its running on :3000. As this is my first foray into React Native I'm at a loss for how to debug. I will now try on Android and update this issue. In the meantime your help would be most welcome.

Many thanks!

Below is the current state of package.json

{
  "name": "RNApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "ios": "open ios/RNApp.xcodeproj",
    "shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82"
  },
  "dependencies": {
    "@exponent/react-native-navigator": "^0.4.7",
    "gravatar-api": "^1.3.4",
    "react": "~15.2.1",
    "react-native": "^0.30.0",
    "react-native-keyboard-spacer": "^0.3.0",
    "react-native-meteor": "1.0.0-rc14",
    "react-native-tab-navigator": "^0.3.0"
  },
  "devDependencies": {
  }
}
hoolymama commented 8 years ago

I just tried on an Android emulator and I get an error message in a dialog saying "RNApp has stopped"

spencercarli commented 8 years ago

That's odd - everything was running fine last night. When you swapped out the contents of index.ios.js were you still registering RNApp? Like it's being done here

hoolymama commented 8 years ago

I think I might have found the problem. Nothing to do with your code...

It looks like the package manager must be closed from one app before starting another. https://github.com/facebook/react-native/issues/3158

When I swapped out the code from AwesomeProject, the only thing I kept was the name of the app being registered "RNApp". But if the problem is the package manager that might explain why it didn't work.

I'm about to logout and restart to see if that's the problem. I'll let you know soon so you can close this issue.

hoolymama commented 8 years ago

It now works on iOS. Looks great! I have a different problem on Android, but I can probably track down. Sorry too have bothered you.

spencercarli commented 8 years ago

No worries. Glad you got it sorted out 😄