Search code examples
reactjsreact-nativeios-simulatorxcode10

React Native: Successfully boots simulator, but application does not completely open, index.ios.js build


I have Xcode 10.1 on my machine.

Yesterday I cloned a React Native project and did an npm install as well as npm install --save react-native-cli so I could use the Simulator as this project seems to be created to go straight to build and be somehow debugged from an ipa/ipk build, not sure how that works, but I am used to debugging from Simulator.

Today, I attempted to boot up simulator, initially it booted up to the point where I could see the app logo and that's as far as it went. I closed it down and attempted to reboot it and it goes through this:

** BUILD SUCCEEDED **


Installing build/Build/Products/Debug-iphonesimulator/AppName.app
Launching com.nist.appname

but the Simulator does not boot up. The following OP helped resolving the Simulator from not booting up again:

React Native BUILD SUCCEED, but "No devices are booted."

However, now the simulator boots up, but the application does not completely boot up, it stops at the display of the application logo.

Today I learned that it was indeed built with react-native-cli to run react-native run-ios, but I guess I initially was expecting to see it in the package.json file, so I don't know if installing it twice caused an issue, but I don't think so, since it did not give me a problem yesterday when I did it.

I believe the problem is index.ios.js build fails. Not sure how to debug that. This is the index.io.js file:

import {AppRegistry} from 'react-native';
import KeyboardManager from 'react-native-keyboard-manager';
import AppName from './App';

KeyboardManager.setToolbarPreviousNextButtonEnable(true);

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

Solution

  • The issue was with an import statement in one of the action.js files.

    Instead of import types from './constants'; like the rest of the types files or constant files, it had import types from './types';

    After I corrected that, the index.ios.js build was succeeding again.