Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not connect to development server just after react-native init #13543

Closed
jaggerwang opened this issue Apr 17, 2017 · 10 comments
Closed

Could not connect to development server just after react-native init #13543

jaggerwang opened this issue Apr 17, 2017 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jaggerwang
Copy link

jaggerwang commented Apr 17, 2017

Description

The ip in bundle url is not my MacBook's local ip 192.168.1.135.

image

After change host & port in "Dev settings" to "192.168.1.135:8081", it still has the same error. The packager server is running.

image

Reproduction Steps and Sample Code

> react-native init gtgj
> cd gtgj
> react-native run-android

Additional Information

  • React Native version: 0.43.3
  • Platform: Android
  • Development Operating System: MacOS
  • Dev tools: react-native
@PARAGJYOTI
Copy link

Did you run react-native-start or not ? if did try adb reverse tcp:8081 tcp:8081 on the directory ~/android/sdk/platform-tools

@jaggerwang
Copy link
Author

@PARAGJYOTI Yes, I'm sure the packager server is running and I do run adb reverse.

@jaggerwang
Copy link
Author

By the way, react-native run-ios is ok, the demo app can run on the iPhone simulator.

@superbigsoft
Copy link

I had the same issue on Windows. After turning off the firewall so that outside world can connect to the packager server then all good. Hope this help.

@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Jul 25, 2017
@hramos hramos closed this as completed Jul 25, 2017
@Aishwarya-Surana
Copy link

I am facing the same issue on android real device.
My react-native version is 0.51.0

@galart
Copy link

galart commented Jan 10, 2018

+1

1 similar comment
@SolveBugs
Copy link

+1

@SaniokUA
Copy link

@Louies89
Copy link

Louies89 commented Feb 19, 2018

Hi All,
I found the same issue while running in windows environment and simulating using android simulator.
After doing some trial & error, I found the solution as below:

1>> Change the port in "\node_modules\react-native\local-cli\server\server.js" from default:

process.env.RCT_METRO_PORT || 8081

to

default: process.env.RCT_METRO_PORT || 9088

if the port is blocked or issued to some other application.
Note: You can choose any port number, I have chosen 9088
2>> Run the command react-native run-android --port 9088 (Put your port number here). This port shall be sent to adb running, so that both server and adb shall be in same port.
3>> Now in Android studio simulator, press Ctrl+m, to go for "Dev Setting", then select Debug Server port & host for Device, set "localhost:9088".
4>> Open developer console in chrome using the url http://localhost:9088/debugger-ui/

Now it will start loading the changes you make in your application.

Enjoy coding now :)

@facebook facebook locked as resolved and limited conversation to collaborators Jul 25, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants