expo / create-react-native-app

Create React Native apps that run on iOS, Android, and web
BSD 3-Clause "New" or "Revised" License
13.26k stars 1.35k forks source link

Network Response Time Out Error #144

Closed aayanqazi closed 7 years ago

aayanqazi commented 7 years ago

Uncaught Error: Java.net,sockettimeoutException: failed to connect to after 10000ms in android after scan QR code

programetica commented 6 years ago

I'm developing on a Centos 7 VirtualBox machine. CyrisXD's advice was the final piece I needed. Other than that, if you're developing on VirtualBox, I suggest disabling the host ethernet connection and setting up the USB filter on your guest (VM) to "add the USB filter with all fields set to the values of the selected USB device..." for the phone/tablet and maybe also for the Wifi card on your host machine. My network is a bridged adapter to the Wifi Adapter on the host.

eassymo commented 6 years ago

Looks like any type of Connection affects to Packager server, so just disable un-used connections and everything works.

(without custom ip REACT_NATIVE_PACKAGER_HOSTNAME)

image

timlorepublic commented 6 years ago

changing the network to private in windows 10 works for me. thanks @sumethy @AurelGit

ChristianHansen93 commented 6 years ago

Uninstalling any virtual machine program solved the problem for me. Seems like it was using the IPV4 from the virtual machine and not from the Lan adapter.

JGeraldoLima commented 6 years ago

I only got it following @mkmpvtltd1 stackoverflow link steps. But before, I did all people said in this issue too Lol. So if you're facing this problem, do all them :)

vmukunda commented 6 years ago

If you have used create-react-native-app to setup your project, I solved this issue by setting the hostname in the package.json file with in the project.

Package.json

"android": "set REACT_NATIVE_PACKAGER_HOSTNAME={your wifi ip address} && react-native-scripts android",

I'm running the app in windows 10.

GautamPanickar commented 6 years ago

@AurelGit Thanks man. Windows 10 users, just go straight towards this guy's solution. Works perfectly!

leo2d commented 6 years ago

I have the same problem today on Win 10 and fix using @CyrisXD instructions.. Thanks!

WinstonNg commented 6 years ago

Thanks @AurelGit ! It works for Windows 10!

syedabdulaala commented 6 years ago

I faced same issue, and found that is was due to firewall. My network was public and in firewall setting Node.js is only allowed to private network. Allowing it for public solve my problem.

AndreiRosu commented 6 years ago

For me, none of the above worked, but the following worked perfectly: access your router settings and disable the "AP Isolation" property. Connect your devices again to the wireless and then the router will let connected devices communicate with each other.

assetcorp commented 6 years ago

For me, it was a firewall problem. I was developing in WSL and the ports were being blocked by windows firewall. I simply added a new rule to my firewall that allowed all ports from within WSL and everything worked fine afterwards.

hariangr commented 6 years ago

I think this happened because react native use wrong ip... so when expo try to connect... it failed

this happened to me because I have virtual ethernet (Because VBox)...I solved the problem by following Muhammad Hannan's solution from https://stackoverflow.com/questions/47966887/expo-lan-configuration-doesnt-work-for-new-reactnative-project

pavan2920 commented 6 years ago

I did all the above steps still the error i am getting.

System : windows 10 Home Phone : one plus 6

Any other checks i need to do ?

MrMRamzan commented 6 years ago

Only problem is that you are not using "same local internet connection on your mobile and PC" I have been facing the same problem but after a lot effort i figure it out

SOLUTION: Use same internet connection on your mobile(on which using expo app) and Computer (running react native app)

MrMRamzan commented 6 years ago

I did all the above steps still the error i am getting.

System : windows 10 Home Phone : one plus 6

Any other checks i need to do ?

https://github.com/react-community/create-react-native-app/issues/144#issuecomment-424768154

ragulan28 commented 6 years ago

@yash2code first check your ip address of your pc .... write ipconfig on cmd ... and then write set REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' then start your project again ...

Still not working for me

kmturley commented 4 years ago

I just can't fathom how ridiculous it is to pick a non-standard web port, and then expect people to manually open their firewall ports. Why not use ports in the normal range 3000 or 8000?

I can't change the firewall rules on my laptop due to Admin restrictions...

After some reading through the source seems it is possible with a .exprc file containing:

{
  "manifestPort": 8000
}
natemartins commented 4 years ago

None of the above suggestions and solutions worked for me.

ghost commented 4 years ago

Don't forget to use Wifi on your smartphone as well!!! glad to help whoever you are ^_^ btw thanks for all the guys above! :)

sami92news commented 3 years ago

And where to write it? cmd/terminal? I am using ubuntu, I am not sure if its doing anything, is there way to check if the command worked (other than testing the expo which is not working for me as well).

ZangUlrich commented 3 years ago

L have the same problem. To resolve it, l add a new rule in my firewall for the port with the following commands:

thinker732 commented 3 years ago

https://stackoverflow.com/a/68881495/15562150

maybe my post will help you it's pretty obvious but i find many people who forget about that

TheIrishPizzaGuy commented 2 years ago

Capture

4 days for me... It was weird because the web version of my react-native build on localhost was working, but expo could not connect. Allow an app through windows firewall -> make sure both Node.js items have access.

gadgetcrawford commented 2 years ago

It's obvious whoever designed this obviously has coding skills, but not how to fix issues as they occur. With so many people having this same issue, you would think they would figure out that maybe they need to fix the connection issues. Expo is a great concept, but unfortunately the developers are in over their head. Back to regular ReactNative CLI for me!

MahmoudAbdullahAnani commented 1 year ago
  1. قم بالنقر على زر "Start" في قائمة البداية.
  2. اكتب "WF" في حقل البحث أو "Windows Firewall" واختر "Windows Defender Firewall with Advanced Security".
  3. ستظهر نافذة "Windows Defender Firewall with Advanced Security".
  4. في القائمة اليسرى، انقر بزر الماوس الأيمن على "Inbound Rules" واختر "New Rule".
  5. ستظهر نافذة مع خيارات متعددة. اختر الخيار "Port" واضغط "Next".
  6. حدد "TCP" وأدخل رقم المنفذ الذي يستخدمه تطبيقك في الحقل "Specific local ports". ثم اضغط "Next".
  7. اختر "Allow the connection" واضغط "Next".
  8. قم بتحديد الشبكات التي ترغب في تطبيق القاعدة عليها. يمكنك تحديد الخيار "Domain", "Private", و "Public" أو اختيار الخيار الذي يناسب حالتك. ثم اضغط "Next".
  9. قم بإعطاء القاعدة اسمًا واضغط "Finish" لإنشاء القاعدة. ( اذا كان الPort مثل 192.168.1.177:19000 فعليك كتابة 19000 )