-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
development server is not started while scanning the QR code in Expo client application #270
Comments
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
Tried disabling Firewall it case it's blocked there, but no luck. I don't have any active antivirus protection. |
Found a troubleshooting section in readme on this and tried http access. This works and yields this result // 20170625170940
// http://10.0.75.1:19000/
{
"sdkVersion": "18.0.0",
"name": "mapper",
"slug": "mapper",
"version": "0.1.0",
"xde": true,
"developer": {
"tool": "crna"
},
"packagerOpts": {
"hostType": "tunnel",
"lanType": "ip",
"dev": true,
"strict": false,
"minify": false,
"urlType": "exp",
"urlRandomness": null
},
"env": {
},
"bundleUrl": "http://10.0.75.1:19001/./node_modules/react-native-scripts/build/bin/crna-entry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=expo/tools/hashAssetFiles",
"debuggerHost": "10.0.75.1:19001",
"mainModuleName": "./node_modules/react-native-scripts/build/bin/crna-entry",
"logUrl": "http://10.0.75.1:19000/logs",
"id": "@anonymous/mapper-183ba25c-82ec-44fa-835f-05f67178c163"
} On the same address but 19001 port there is only a message 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 |
thanks @brentvatne, |
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. |
@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 So you could make a file at |
Today i got the same error (Network response timed out.) also couldn't access packager's address from iphone's browser. |
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 :) |
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" |
@FredyC - it just uses the |
@brentvatne Ok, I see. The |
I ran into this problem today, and then this github issue. It might be helpful to realize there are two facets to the multiple IP address situation. The first facet is what IP address the server is listening on. Via netstat -an, you can see that the server is listing on all of the computer's IP addresses: So that facet seems solved already. The second facet is which IP address to tell the user to type into Expo (or to transmit via the QR code). This is a more difficult problem, because you don't know for sure how the user has configured their network. Idea 1: If you're on Windows and can access its details for each network adapter, you could guess that the user's phone is probably on a "Wireless LAN adapter" rather than an "Ethernet adapter". Idea 2: Since QR codes have the capacity for 406 bytes, you could transmit an array of IP addresses, and the app can try each of them until it finds one that works. Idea 3: Use a different protocol that does some sort of subnet broadcast. |
Thanks @ahmetkakici . That worked for me :-) |
@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 |
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. |
I disabled all the virtualBox adapters and then it worked |
@bbeckk You are most likely having same issue as me and instead of disabling you can change network adapter priorities ... #270 (comment) |
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 I went to the settings of my wi-fi adapter and changed metrics on TCPIP4 to Now CRNA with |
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. |
I solved this issue through updating my iPhone expo app. It worked smoothly. |
Stopped my xampp server and it worked like magic |
remove security apps on phone working for me |
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. |
@FredyC Thanks for your insightful answer. I had a similar problem as there was a virtual connection of VmWare running. Thanks |
In my case, I try |
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! |
Description
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
Environment
react-native-scripts
:--react-native-scripts@0.0.31react-native
:-- react-native@0.44.3expo
:-- expo@17.0.0node -v
:v6.10.1npm -v
:3.10.10yarn --version
:N/Awatchman version
:The text was updated successfully, but these errors were encountered: