Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native init not working getting can't find variable _fbBatchedBridge IOS simulator

Tags:

react-native

I posted this in the react native GitHub but was asked to post it here

I followed the instructions on the website to get a React native app up and running.

I get the following messages Genymotion Andriod simulator Reference Error: can't find variable _fbBatchedBridge IOS simulator Unable to execute JS call: _fbBatchedBridge is undefined React Package Manager synchronization failed

React native version 0.18.0 React native cli 0.1.10 Node 4.2.4

Mac Os X Yosemite XCode Version 7.2

In researching this many claim that the issue is with the network. I opened a browser pointing at localhost:8081 and got a webpage with Cannot GET /

Currently, I am not getting any error message on the IOS simulator, just a blank white screen. Android is still giving the same error message on both Genymotion and my local Android device.

There are no error messages on the Terminal or in XCode.

This is very frustrating to try to troubleshoot since I have no idea why it is not working or even where to start.

like image 319
nwilliams36 Avatar asked Apr 26 '26 12:04

nwilliams36


1 Answers

This error is because the script server is not running.

For Android version, in addition to execute 'react-native run-android' to build the app, you need to execute 'react-native start' to start the script server.

In XCode when you run the application the terminal should be started automatically, but it seems something is wrong in your case. Did you try to close the terminal window and start over?

============================== when you first start the script server, the console should show

[18:07:15] <START> Building Dependency Graph
[18:07:15] <START> Crawling File System
[18:07:15] <START> Loading bundles layout
[18:07:15] <END>   Loading bundles layout (1ms)

React packager ready.

When your client connects to the server, the console should show

[18:07:25] <START> request:/index.android.bundle?platform=android&dev=true
[18:07:25] <START> find dependencies
[18:08:01] <END>   Crawling File System (45771ms)
[18:08:01] <START> Building in-memory fs for JavaScript
[18:08:04] <END>   Building in-memory fs for JavaScript (3382ms)
[18:08:04] <START> Building in-memory fs for Assets
...

if the second part was not showing up, you may want to check whether you can use the port: enter image description here With this image you can see the url should be http://localhost:8081/index.android.bundle?platform=android&dev=true . If you cannot open it in your browser you may need to check your firewall setting or anything else blocking the access.

Also you may want to search index.android.bundle in your native code to check whether the dev url has been modified.

like image 92
YANG Lei Avatar answered Apr 28 '26 02:04

YANG Lei