Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 720
Nah Avatar asked Dec 25 '17 08:12

Nah


People also ask

How do I start a new React Native project Expo?

Running your React Native application Install the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.

How do I change my LAN to tunnel?

Expo runs the application in LAN by default and you can switch to Tunnel by simply clicking on it. Expo might prompt you to register to their platform and create an account if you haven't. This will take only a few minutes. After you have an account, switching yo tunnel mode should be enable for your application.

How do I migrate from Expo to React Native command line?

Ensure you have updated your existing project to the same React Native version that is used by the latest version of the Expo SDK and that your existing project is running as expected with all tests passing. Copy your assets and JS/TS source files to your new project. Copy the dependencies from your package.

Is Expo good for React Native?

Here are some good reasons to use Expo to build your React Native app. If you are given a project that needs rapid development, and you have picked React Native to build the cross-platform app, Expo is the best fit for you. With Expo, you can build and deploy React Native apps for both iOS and Android with ease.


1 Answers

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%

like image 164
Govind Kumar Thakur Avatar answered Sep 28 '22 10:09

Govind Kumar Thakur