2

i trying to open a new project in my iphone , and it shows this message:enter image description here

NOTE: the connection is LAN , on TUNNEL mode it works fine but slow

Afik Menashe
  • 77
  • 1
  • 1
  • 8

3 Answers3

2

You tried to connect to the wrong IP. the 127.0.0.1 is a localhost IP. You have to change to the IP where your Metro Builder Server runs on.

Maybe this Thread helps you to change to the correct IP: React Native Expo change default LAN IP

Yonggan
  • 140
  • 1
  • 10
  • I executed this command as he say 'set REACT_NATIVE_PACKAGER_HOSTNAME=my ip' , but nothing change except of the ip number on the screen, another idea? – Afik Menashe Mar 25 '20 at 19:23
  • Is your metro builder server running? Maybe you can provide us the log output of the server? – Yonggan Mar 26 '20 at 21:47
1
  1. Open Start > Control Panel > System
  2. Go to Advanced System Settings > Environment Variables
  3. Set a System Environment Variable with the following name/value pair:
  4. name: REACT_NATIVE_PACKAGER_HOSTNAME
  5. value: < the IPv4 address you want to use > (if any address does not work, enter the current address IPV4 you are using)

That’s it!

IMPORTANT: remember to close and re-open the elevated PowerShell command prompt, since newly added Environment Variables wont’ be available on the existing prompts.

Zezinho
  • 11
  • 1
-2
  • Change to LAN connection type in expo-cli
  • Open it again from your phone
  • If you get a similar error but with your LAN IP, your network does not allow connections between devices on the network, and you need to use tunnel or use simulator with localhost.
brentvatne
  • 7,603
  • 4
  • 38
  • 55