I have a react native (0.55.4) project and it is working fine on Android or iOS simulator. But when I am running it from Xcode (9.3), the app starts on the device, shows the splash screen, the metro bundler starts on the mac BUT the app is not getting connected to the bundler/packager.
There is no process shown (green bar) which bundles the js code.
Also I am getting these logs on the xcode output :
2018-05-18 17:00:46.613995+0530 Thunderpod[42517:6526595] NSURLConnection finished with error - code -1001
2018-05-18 17:00:46.637 [info][tid:main][RCTCxxBridge.mm:210] Initializing <RCTCxxBridge: 0x1c01c3480> (parent: <RCTBridge: 0x1c00c6270>, executor: (null))
2018-05-18 17:00:46.633051+0530 Thunderpod[42517:6526595] Task <CE0CD57D-C025-4768-91D1-C9A03F02C072>.<0> HTTP load failed (error code: -999 [1:89])
2018-05-18 17:00:46.645156+0530 Thunderpod[42517:6526510] Initializing <RCTCxxBridge: 0x1c01c3480> (parent: <RCTBridge: 0x1c00c6270>, executor: (null))
2018-05-18 17:00:46.689 [warn][tid:main][RCTBridge.m:119] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-05-18 17:00:46.689056+0530 Thunderpod[42517:6526510] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
After these my app's (named: Thunderpod) logs are being shown:
2018-05-18 17:00:46.771 [info][tid:main][RCTRootView.m:293] Running application Thunderpod ({
initialProps = {
};
rootTag = 1;
})
2018-05-18 17:00:46.770981+0530 Thunderpod[42517:6526510] Running application Thunderpod ({
initialProps = {
};
rootTag = 1;
})
2018-05-18 17:00:47.377 [info][tid:com.facebook.react.JavaScript] Running application "Thunderpod" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2018-05-18 17:00:47.376715+0530 Thunderpod[42517:6527004] Running application "Thunderpod" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2018-05-18 17:00:47.395 [warn][tid:com.facebook.react.JavaScript] Persistor added to window variable
2018-05-18 17:00:47.394879+0530 Thunderpod[42517:6527004] Persistor added to window variable
2018-05-18 17:00:47.407 [info][tid:com.facebook.react.JavaScript] On before lift
2018-05-18 17:00:47.406652+0530 Thunderpod[42517:6527004] On before lift
2018-05-18 17:00:47.409 [info][tid:com.facebook.react.JavaScript] 'Persistor restored:', { rootReducer: { isFirstTime: true },
userDataReducer:
{ userRegistrationType: 'none',
userCountryData: { name: '-', callingCode: '-', countryCode: '-' },
userMobileNumber: '',
userFacebookData: {},
userPhoneData: {} },
_persist: { version: -1, rehydrated: true } }
2018-05-18 17:00:47.408920+0530 Thunderpod[42517:6527004] 'Persistor restored:', { rootReducer: { isFirstTime: true },
userDataReducer:
{ userRegistrationType: 'none',
userCountryData: { name: '-', callingCode: '-', countryCode: '-' },
userMobileNumber: '',
userFacebookData: {},
userPhoneData: {} },
_persist: { version: -1, rehydrated: true } }
2018-05-18 17:00:47.412 [info][tid:com.facebook.react.JavaScript] [App] Render
2018-05-18 17:00:47.412247+0530 Thunderpod[42517:6527004] [App] Render
2018-05-18 17:00:47.509556+0530 Thunderpod[42517:6526510] refreshPreferences: HangTracerEnabled: 0
2018-05-18 17:00:47.509604+0530 Thunderpod[42517:6526510] refreshPreferences: HangTracerDuration: 500
2018-05-18 17:00:47.509622+0530 Thunderpod[42517:6526510] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
2018-05-18 17:00:47.717 [info][tid:com.facebook.react.JavaScript] Component did mount.. Checking user authentication..
2018-05-18 17:00:47.717345+0530 Thunderpod[42517:6527004] Component did mount.. Checking user authentication..
2018-05-18 17:00:47.801047+0530 Thunderpod[42517:6527003] [] nw_connection_get_connected_socket 2 Connection has no connected handler
2018-05-18 17:00:47.801124+0530 Thunderpod[42517:6527003] TCP Conn 0x1c416f780 Failed : error 0:61 [61]
2018-05-18 17:00:47.916899+0530 Thunderpod[42517:6527008] [] nw_connection_get_connected_socket 3 Connection has no connected handler
2018-05-18 17:00:47.916938+0530 Thunderpod[42517:6527008] TCP Conn 0x1c416dec0 Failed : error 0:61 [61]
2018-05-18 17:00:48.075 [warn][tid:com.facebook.react.JavaScript] Warning: isMounted(...) is deprecated in plain JavaScript React classes. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.
2018-05-18 17:00:48.074829+0530 Thunderpod[42517:6527004] Warning: isMounted(...) is deprecated in plain JavaScript React classes. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.
20
Also note that the logs are being repeated !!
What is wrong with my setup ?
Edit: I created a new project and without making any changes I ran it using xcode and its giving me the same issue !!
Here is the package.json & my XCode version is 9.3 (9E145) which was working fine till yesterday:
{
"name": "TestXcode",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4"
},
"devDependencies": {
"babel-jest": "22.4.3",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.3",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
}
}