Sathyakumar Seshachalam
Sathyakumar Seshachalam

Reputation: 2053

react native run-ios fails

This was working just Friday. No change in code. (Other than doing a time machine backup in Mac).

But since today react-native run-ios just does not seem to be working. The simulator comes up, but then the usual loading http://localhost:8081 does not show up any more. No errors or any indication on why this is failing. The simulator shows my App in home screen. Double clicking it just brings up and the app seems to crash immediately.

But react-native run-android works fine.

Am not sure where to even begin debugging this. (Am new to whole app development).

A few observations,

  1. when I run npm start and then run react-native run-ios, it usually "detects" that packager is running and skips launchPackager command, but today its not the case, the launchPackager opens regardless of whether a package is already running (Happens both with run-android and run-ios
  2. There is usually below lines once the app begins loading. But today they only show up when I run react-native run-android

    8:43:46 PM] find dependencies transformed 728/728 (100%) [8:43:46 PM] find dependencies (553ms) [8:43:46 PM] request:/index.android.bundle?platform=android&dev=true&hot=false&minify=false (661ms)

And when I run react-native logs-ios, I get the below errors

Sep 12 20:53:15 sseshac-in-la com.apple.CoreSimulator.SimDevice.ADE00521-C04E-4EC5-8BE2-FE729523A0B9.launchd_sim[3812] (UIKitApplication:org.reactjs.native.example.X[0x3f02][4589]) <Notice>: Service exited due to signal: Abort trap: 6
Sep 12 20:53:15 sseshac-in-la assertiond[3832] <Error>: assertion failed: 15G31 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Sep 12 20:53:15 sseshac-in-la Unknown[3832] <Error>:
Sep 12 20:53:15 sseshac-in-la SpringBoard[3828] <Warning>: Application 'UIKitApplication:org.reactjs.native.example.X[0x3f02]' crashed.
Sep 12 20:53:15 sseshac-in-la assertiond[3832] <Error>: assertion failed: 15G31 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Sep 12 20:53:15 sseshac-in-la Unknown[3832] <Error>:
Sep 12 20:53:15 sseshac-in-la assertiond[3832] <Warning>: notify_suspend_pid() failed with error 7
Sep 12 20:53:15 sseshac-in-la assertiond[3832] <Error>: assertion failed: 15G31 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Sep 12 20:53:15 sseshac-in-la Unknown[3832] <Error>:
Sep 12 20:53:15 sseshac-in-la SpringBoard[3828] <Warning>: Reply Error: Connection interrupted 
Sep 12 20:58:36 sseshac-in-la routined[3817] <Error>: CoreLocation: Error occurred while trying to retrieve motion state update: CMErrorDomain Code:104

UPDATE: I think the root cause seems to below error

<Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'bundleURL must be non-nil when not implementing loadSourceForBridge'

Note that I am using React native 0.32. I understood that now it "detects" rather than hardcoding the bundleUrl. If someone can throw light on where this "detection" is, will be helpful

Upvotes: 1

Views: 1964

Answers (2)

Joe
Joe

Reputation: 2601

Probably you have problem with the packager make sure your modules all built you can check by opening http://localhost:8081/index.ios.bundle?platform=ios&dev=true in the browser after the build you will get the error

Upvotes: 1

Sathyakumar Seshachalam
Sathyakumar Seshachalam

Reputation: 2053

Problem turned out to be I was missing an entry in /etc/hosts

127.0.0.1   localhost

I still don't have any clue why it would work before. But that solved it

Upvotes: 3

Related Questions