Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

react native - Expo LAN configuration doesn't work for New ReactNative Project

I have seen similar questions on Stackoverflow but none sorted the problem. I have just created new ReactNative project from Expo desktop app. But I can not run it on my Android phone via QR code scan when Expo configuration is set to LAN mode. Which seems not accessible on my Android phone (looks like). My phone is on same Wifi network.

I have also tried to run Expo demo app by turning off Firewalls but still no success. I'm sure your one technical look might soft my issue.

Note: The Expo tunnel was down that's why it loaded in LAN mode. Few days ago I tried Tunnel mode which works. But, at that time too LAN didn't work. So may be any one can point me in right direction, so I can run it in LAN mode (being on Phone and Machine on same Wifi Network).

My IP Config

Expo Desktop App

Expo App when tries to load demo app after scanning QR code

Netstat command result for port 19000

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I am not sure this helps you or not but in my case, this helps me so you can also try this:

1: First of all you have to increase the WiFi Adapter priority( Interface Metric)

Goto Control Panel > Network and Internet > Network Connections

step 1) Right-click on the wi-fi as shown in the above image and right-click > Click Properties

steps 1 screenshot

step 2) select Internet Protocol Version 4 and > Click Properties

steps 2 screenshot

step 3) click on > Advanced

steps 3 screenshot

step 4)

  1. Uncheck 'Automatic Metric'
  2. Enter 5 in 'Interface Metric'
  3. click ok

steps 4 screenshot

2: You have to change your wifi network profile from Public to private

step 1) selecting your network from available WiFi network and click Properties

steps 2 screenshot

step 2) change your network profile from Public to Private

steps 2 screenshot

That's it now run your expo project on LAN it will work 100%


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...