You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
development server is not started while scanning the QR code in Expo client application #270
I recently started to learn React-Native and created a CRNA project.
whenever I scan the QR code in Expo App , the application is not started on my android device though my mobile is connected to same wireless network as my PC (windows)
Expected Behavior
I tried to run "npm start" in command line.code compiled successfully and QR code generated in command line.Whenever I scan this code through Expo app it is not starting my apllication in android device.
Observed Behavior
I got following error
Something went wrong.
could not load exp://192.168.*.**:19000. Network response timed out.
error-log---
uncaught error:java.net.SocketTimeoutException: failed to connect to /192.168.*.**(port 19000) after 10000ms
Hey, I am trying very same thing and failing with same error as well. Here are the versions in my case. I am really just starting to know React Native. I haven't done any change there, just clean run of create-react-native-app (no errors during that).
On the same address but 19001 port there is only a message React Native packager is running..
Trying to access same address on the phone doesn't work, it cannot connect. I also tried connecting my computer to a wifi hotspot created on the phone. Same result.
Also noticed the url http://10.0.75.1:19000/logs in the output above, but that doesn't work either (on a computer).
Honestly, I don't think that IP address is a correct one there. I am not sure how is that obtained, but my network runs on regular 192.168.0.XXX addresses. How can my phone find that IP address?
@FredyC I got an alternative for same problem
please download "Expo XDE" (desktop application) it will definately solve your problem.
following steps you need to follow
1-download Expo XDE for your appropriate OS(ie. windows or mac) from https://expo.io/
2-open Expo XDE and you will find your CRNA project , click on specific project you want to run ,,
3- click on the gear icon in address bar and select host as a Lan , here you will find your "ipAddress:host"
paste this address to your expo mobile App in explore section
and if everything is right then you will get your application running on your mobile .....
hope it will help you
Reacted by Abhishek Aggarwal, Stan Luo, haroonabbasipl, Eustațiu Iagăru, Vishal Sherathiya, Scott N Hwang, PhD, MD, Mathieu Dumez, Aaron Makaruk, Adrienne, Vineet Setia and 17 more
Reacted by Vineet Setia, Gunesh Shanbhag, Julian Biebelberg, DUONG TIEN HIEU, omadoyeabraham, Sean Lester-Wilson and Allen J.K.
Reacted by Abhishek Aggarwal, Nnenanya Obinna Kingsley, haroonabbasipl, Vishal Sherathiya, Mathieu Dumez, Julian Biebelberg, Sankalp Ranade, omadoyeabraham, TheRealMessie, Sean Lester-Wilson and 2 more
Reacted by Nnenanya Obinna Kingsley, haroonabbasipl, Vishal Sherathiya, Mathieu Dumez, Gunesh Shanbhag, Julian Biebelberg, Rafael Araujo Lehmkuhl, omadoyeabraham, Victor Igor, Sean Lester-Wilson and 3 more
thanks @brentvatne,
but unfortunately I got same error after setting enviornment variables. Only solution I got so for is to run my CRNA app in "Expo XDE" as I explained in my above comment .
thanks for the help buddy
Ok, I think I've found the culprit. I have a Docker installed which has its own network adapter. For some reason the Expo picks this virtual network over the real one. Using env variable as @brentvatne suggested works, but it's totally cumbersome solution.
I am wondering if this could be somehow configurable per project.
Reacted by Cas Cornelissen, bbeckk, Mostafa Armandi, Dilhan Jayathilake, mhannan, Andrea Stella, Faisal Janjua, Dichha Rai, Ludovico Dellavecchia, Ravin Singh D and 5 more
Reacted by Andrea Stella
Reacted by Dilhan Jayathilake, Andrea Stella and Ludovico Dellavecchia
Reacted by Dilhan Jayathilake, Andrea Stella, Faisal Janjua, Dichha Rai, Ludovico Dellavecchia and vishalshineweb
@FredyC One thing that might achieve a lot of what you are looking for is to use direnv (https://direnv.net). When you have direnv installed on your computer and set up in your shell profile, it will check for a file called .envrc, which is just a Bash script, in every directory you cd into.
So you could make a file at ~/your-project/.envrc with export REACT_NATIVE_PACKAGER_HOSTNAME=$(hostname) and it would apply only when your terminal is in your project directory (or one of its subdirectories).
Today i got the same error (Network response timed out.) also couldn't access packager's address from iphone's browser.
The problem was packager gets the first network adapter's local address (for me it was virtual-box adapter) 192.168.56.1 but my wireless network's local address was 192.168.1.28
So instead of scanning url, i manually entered exp://192.168.1.28 to expo ios-app and it worked.
Reacted by Simon Vuong, devWebN@ts, bbeckk, Abdullah Rahman, Govard Barkhatov, Alex Neo, Ishara Madhawa and William Park
Reacted by Adrysson Lima
Reacted by Dichha Rai, Carlos Castro, vishalshineweb and Adrysson Lima
Anyway, in my opinion, this should be solved on the Expo side to allow to pick which adapter to use. It's not always feasible to switch adapters priorities, in particular for people moving between e.g. wifi and wired connection.
@FredyC - I don't know much about network adapter priorities and have never encountered this issue myself -- would you be interested in helping us handle this on the Expo side?
@brentvatne Sure thing, just let me know what do you need from me. I am not sure about the way how Expo is finding that IP address. If you have access to a list of adapters of there is some high-level API only.
I have tried all the suggestions listed above, but none of them worked. Here the error message that I got on my phone: "Uncaught Error: java.net.SocketTimeoutException:connect timed out"
Could someone help me out?
@brentvatne Ok, I see. The ip.address() allows specifying the name of the network adapter in a first argument. So if Expo can read that optionally from some config, it could solve all problems.
@davidsickmiller I agree that some of these solutions would be very good. Implementing any of them will require some effort on the Expo client side, and we're tracking that work over there.
Until we have these network reliability features impl'd (which we're tracking on the client roadmap), I believe setting REACT_NATIVE_PACKAGER_HOSTNAME will work for all of the issues raised in this thread, so I'm going to give this a close. Thanks!
Just in case it may help someone. In Windows 10, after looping through all workarounds on this thread with no luck I've managed to get it working by disabling and re-enabling the wifi connection. Besides from the firewall rules, every other setting is out of the box.
It's worth to say that at some point I reset the network settings as well, which cleans all your wifi passwords among other net stuff, proceed carefully.
Hey everyone! This particular issue has been resolved for a while now. If you're still having issues with a similar message and have tried the solutions in this thread, please open a new issue. Thanks!
Activity
danielkcz commentedon Jun 25, 2017
Hey, I am trying very same thing and failing with same error as well. Here are the versions in my case. I am really just starting to know React Native. I haven't done any change there, just clean run of
create-react-native-app(no errors during that).Tried disabling Firewall it case it's blocked there, but no luck. I don't have any active antivirus protection.
danielkcz commentedon Jun 25, 2017
Found a troubleshooting section in readme on this and tried http access. This works and yields this result
On the same address but 19001 port there is only a message
React Native packager is running..Trying to access same address on the phone doesn't work, it cannot connect. I also tried connecting my computer to a wifi hotspot created on the phone. Same result.
Also noticed the url http://10.0.75.1:19000/logs in the output above, but that doesn't work either (on a computer).
Honestly, I don't think that IP address is a correct one there. I am not sure how is that obtained, but my network runs on regular 192.168.0.XXX addresses. How can my phone find that IP address?
San10694 commentedon Jun 26, 2017
@FredyC I got an alternative for same problem
please download "Expo XDE" (desktop application) it will definately solve your problem.
following steps you need to follow
1-download Expo XDE for your appropriate OS(ie. windows or mac) from https://expo.io/
2-open Expo XDE and you will find your CRNA project , click on specific project you want to run ,,
3- click on the gear icon in address bar and select host as a Lan , here you will find your "ipAddress:host"
paste this address to your expo mobile App in explore section
and if everything is right then you will get your application running on your mobile .....
hope it will help you
brentvatne commentedon Jun 27, 2017
this might also be useful for you folks: https://github.com/react-community/create-react-native-app/blob/d01ddabb634532200629c6d17f920eb856fa6416/react-native-scripts/template/README.md#environment-variables
San10694 commentedon Jun 28, 2017
thanks @brentvatne,
but unfortunately I got same error after setting enviornment variables. Only solution I got so for is to run my CRNA app in "Expo XDE" as I explained in my above comment .
thanks for the help buddy
danielkcz commentedon Jun 29, 2017
Ok, I think I've found the culprit. I have a Docker installed which has its own network adapter. For some reason the Expo picks this virtual network over the real one. Using env variable as @brentvatne suggested works, but it's totally cumbersome solution.
I am wondering if this could be somehow configurable per project.
ide commentedon Jun 29, 2017
@FredyC One thing that might achieve a lot of what you are looking for is to use direnv (https://direnv.net). When you have direnv installed on your computer and set up in your shell profile, it will check for a file called
.envrc, which is just a Bash script, in every directory youcdinto.So you could make a file at
~/your-project/.envrcwithexport REACT_NATIVE_PACKAGER_HOSTNAME=$(hostname)and it would apply only when your terminal is in your project directory (or one of its subdirectories).ahmetkakici commentedon Jun 30, 2017
Today i got the same error (Network response timed out.) also couldn't access packager's address from iphone's browser.
The problem was packager gets the first network adapter's local address (for me it was virtual-box adapter) 192.168.56.1 but my wireless network's local address was 192.168.1.28
So instead of scanning url, i manually entered exp://192.168.1.28 to expo ios-app and it worked.
danielkcz commentedon Jun 30, 2017
Yea, in the end, I've solved the problem by changing priorities of my network adapters so the one I want is a first one. Works like magic :)
danielkcz commentedon Jun 30, 2017
Anyway, in my opinion, this should be solved on the Expo side to allow to pick which adapter to use. It's not always feasible to switch adapters priorities, in particular for people moving between e.g. wifi and wired connection.
brentvatne commentedon Jun 30, 2017
@FredyC - I don't know much about network adapter priorities and have never encountered this issue myself -- would you be interested in helping us handle this on the Expo side?
danielkcz commentedon Jun 30, 2017
@brentvatne Sure thing, just let me know what do you need from me. I am not sure about the way how Expo is finding that IP address. If you have access to a list of adapters of there is some high-level API only.
GJS153 commentedon Jul 6, 2017
I have tried all the suggestions listed above, but none of them worked. Here the error message that I got on my phone: "Uncaught Error: java.net.SocketTimeoutException:connect timed out"
Could someone help me out?
brentvatne commentedon Jul 25, 2017
@FredyC - it just uses the
ipnode package --ip.address()-- https://github.com/expo/xdl/blob/1e3f6637244b112a23963294f71a6a8d2e1b55c8/src/UrlUtils.js#L222danielkcz commentedon Jul 25, 2017
@brentvatne Ok, I see. The
ip.address()allows specifying the name of the network adapter in a first argument. So if Expo can read that optionally from some config, it could solve all problems.2 remaining items
anp commentedon Oct 17, 2017
@davidsickmiller I agree that some of these solutions would be very good. Implementing any of them will require some effort on the Expo client side, and we're tracking that work over there.
Until we have these network reliability features impl'd (which we're tracking on the client roadmap), I believe setting
REACT_NATIVE_PACKAGER_HOSTNAMEwill work for all of the issues raised in this thread, so I'm going to give this a close. Thanks!fraylopez commentedon Oct 23, 2017
Just in case it may help someone. In Windows 10, after looping through all workarounds on this thread with no luck I've managed to get it working by disabling and re-enabling the wifi connection. Besides from the firewall rules, every other setting is out of the box.
It's worth to say that at some point I reset the network settings as well, which cleans all your wifi passwords among other net stuff, proceed carefully.
bbeckk commentedon Nov 11, 2017
I disabled all the virtualBox adapters and then it worked
danielkcz commentedon Nov 11, 2017
@bbeckk You are most likely having same issue as me and instead of disabling you can change network adapter priorities ... #270 (comment)
gbarkhatov commentedon Dec 8, 2017
It was an issue for me. Having latest versions/updates of everything. Win10, vmware, vbox, create-react-native-app.
Tried disabling and enabling the firewall.
Though it worked from Expo XDE, I just felt like it should work on CLI.
So the issue was (as described earlier by @ahmetkakici) that
yarn startwas usingvmwarenetwork adapter.I went to the settings of my wi-fi adapter and changed metrics on TCPIP4 to
2https://www.ghacks.net/2016/12/02/change-network-adapter-priorities-in-windows-10/
Now CRNA with
yarn startpoints to the proper IP and everything is working from CLInickcarenza commentedon Jan 10, 2018
For me this was caused by the port range not being accessible.
To solve, I made a .exprc file like this:
It seems to be an undocumented config file.
evanslight commentedon Jan 28, 2018
I solved this issue through updating my iPhone expo app. It worked smoothly.
joshuachinemezu commentedon Feb 25, 2018
Stopped my xampp server and it worked like magic
gusleo commentedon Mar 20, 2018
remove security apps on phone working for me
aliraza4167 commentedon Apr 4, 2018
Yes the problem was that I had VirtualBox installed and it had its own virtual network adapter. Disabled it and ran "npm run android" and it worked.
ZulqarnainSyed commentedon Apr 13, 2018
@FredyC Thanks for your insightful answer. I had a similar problem as there was a virtual connection of VmWare running. Thanks
hulk-pham commentedon Jun 24, 2018
In my case, I try
set REACT_NATIVE_PACKAGER_HOSTNAME='localhost'
and it worked
anp commentedon Jun 27, 2018
Hey everyone! This particular issue has been resolved for a while now. If you're still having issues with a similar message and have tried the solutions in this thread, please open a new issue. Thanks!