5

I am using expo-cli@3.0.10enter image description here This app works fine in client expo which installed in device

Yahya Mukhtar
  • 474
  • 5
  • 13

4 Answers4

4

Ok I believe I found the core problem - DNS issue.

Your Android simulator cannot properly resolve the hostname using your current DNS for whichever OS you are on be it Mac OS, Windows or Linux.

Follow this link to set your DNS address to 8.8.8.8 or some other applicable DNS.

Once you set your DNS properly it should work. Make sure that 8.8.8.8 is the first DNS address in the list(?) of DNS addresses so that your system will resolve hostnames using the Google DNS first.


Reposting the useful information from that link below,

Change the DNS address of your network to 8.8.8.8:

MacOSX:

Open "System Preferences"
Click on "Network"
Select the network which your computer is connected and click on "Advanced"
Select "DNS", Select the "+" button, type "8.8.8.8"
Select "Ok" and "Apply"

Windows & Linux:

https://developers.google.com/speed/public-dns/docs/using

After that close the emulator and start it again.

Seng Wee
  • 534
  • 9
  • 20
1

This case happened to me whenever I switch from a network to another without restarting my emulator.

The simplest way to solve this was to restart my emulator.

I hope it helps,

mahmoud mehdi
  • 1,493
  • 1
  • 19
  • 28
1

For my case, this error occurred because I changed from LAN to Wireless Internet connection while the project is building.

Solution: Close the Emulator and restart Android Studio. Run the project (either npm start or expo start) and this worked for me.

0
  1. You need to start expo server first. Use expo start. Then run your project.

After starting your expo server re-start your project.

Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32
  • 1
    I had the same problem. This is not because OP didn't run the command `expo start`. Looking into this problem now too. – Seng Wee Sep 13 '19 at 06:57