react native expo launch app time out - react-native

Using create react native app, I get this error when I scan the QR code from the package manager:
java.net.SocketTimeoutException - connect timed out
I have my Samsung s8 connected via USB, I can see the following json when I browse to the address using http instead of exp:
{"sdkVersion":"23.0.0","name":"tester1","slug":"tester1","version":"0.1.0","xde":true,"developer":{"tool":"crna","projectRoot":"C:\\sites\\tester1"},"packagerOpts":{"hostType":"tunnel","lanType":"ip","dev":true,"strict":false,"minify":false,"urlType":"exp","urlRandomness":null},"env":{},"bundleUrl":"http://169.254.140.132:19001/./node_modules/react-native-scripts/build/bin/crna-entry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=C:\\sites\\tester1\\node_modules\\expo\\tools\\hashAssetFiles","debuggerHost":"169.254.140.132:19001","mainModuleName":"./node_modules/react-native-scripts/build/bin/crna-entry","logUrl":"http://169.254.140.132:19000/logs","id":"#anonymous/tester1-e649dd6c-008d-4356-a9eb-0f80bb8a6a98"}
Can anyone please help? I've spent ages trying to get this working

I disabled my other connections. Expo was defaulting to the wrong IP.
Control Panel > Network and Internet > Network Connections

Related

React Native - expo go not able to connect

I'm very new to React Native and I'm understanding now Ports and similar things. In the last days I was able to access through Expo Go my app, but starting from today I ran into issues.
I think the problem was, that I was accessing the app using an university wi-fi connection, while the other days I used a mobile data connection. With Wi-Fi I was not able to access the app. The error log said: java.net.connectException: failed to connect to (...)
So I started a big journey thorugh ports, ip addresses and firewall, arriving to the ubuntu's ufw. Actually I don't know exactly what I've done, but the last try was to disable everything (like it was at the beginning) and retrying to access the app, nothing changed. The error log was: java.net.SocketTimoutException: failed to connect to (...) from (...)
I tried also use tunnel (like this question says Unable to connect to Expo React Native Project on WSL2 with Expo Go on phone) but it didn't help. In this case, the app says New update avalable: downloading... but never ends.
So, any suggestion to understand a) which is the real problem (a part that I've done something that I didn't understand) and b) how to solve it ?

Is it possible to start expo on a custom domain?

I am trying to develop React Native app using Code Server hosted in the cloud.
Is it possible to run expo with a custom domain, so I can access the link using a mobile device? By default, expo is waiting on exp://10.0.0.186:19000, and it is not accessible over the Internet.
I can specify a custom port using expo start --port XXX, but I don't know if I can specify a custom domain?
I tried using --tunnel switch, but it does not work and it outputs:
Error starting ngrok: /usr/lib/node_modules/expo-cli/node_modules/xdl/binaries/linux/adb/adb: 1: Syntax error: Unterminated quoted string
Tunnel URL not found (it might not be ready yet), falling back to LAN URL.

Scanning Error Expo: Network response time out

When the QR code on the dashboard of my laptop is scanned by the Scanner of Expo in my Android, it shows the error "Something went wrong Network response time out".
And when I open error log file, it shows "Uncaught Error: Java. net. SocketTimeoutExpection".
What should I do it?
Double check your local IP address that is running EXPO and look at the IP Address that EXPO is running on - these should match minus the port.
So for example, if your local machine has an IP of 192.168.0.210, EXPO should be Opening exp://192.168.0.210:19000. If they differ, you must change the EXPO environment variable for the IP address. Refer to React Native Expo change default LAN IP for that

How to detect slow internet connections in React Native

I'm using a React Native app built with expo. I wanted to know how to detect slow internet connection using it.
If you are using expo then you can check the netinfo docs, where type of connection will give an approx of network speed. expo netinfo
If you want to check the network status that suddenly it went down or offline you can use the react-native-offline library as it constantly pings and checks , and its documentation is good . react-native-offline

Unable to connect Android phone to my project with Expo

I created my project in react native by CLI:
_npm install -g create-react-native-app
_create-react-native-app AwesomeProject
_cd AwesomeProject
_npm start
Then I installed expo in my Android phone, and scanned a QR code on my computer screen.
However, my phone can't connect to project, and I don't know why. It just loads and fails. This is error message:
Could not load exp:// 192.168.56.1:19000. Network response timed out.
This is view error:
"Uncaught Error: java,not.SocketTimeoutException: faild to connect to/192.168.56.1 (port 19000) after 10000 ms.
I'm trying to fix it, but still can't get it working. My phone and my laptop are on the same network. What can I do now?
I had the same problem but solved by running expo start --tunnel
Select LOCAL instead of LAN.
I kicked myself when I fixed this.
I had the same issue, turns out my firewall was blocking my connection to the development server port (for me it was 19000). Solved it by disabling firewall.
Choose Tunnel Instead of LAN or Local in connection tab. This solved the issue for me.
Keep a look on this issue for the answer:
https://github.com/react-community/create-react-native-app/issues/60
Make sure that your device and computer are one same LAN/Wifi. It will work.
Also use LAN option.
check open port using
ufw status verbose
And if you don't see the port You are working on
for example 19000 => expo
try this
ufw allow 19000
I've had a similar problem on iOS - the project showed up in the Expo app but didn't want to connect.
Here's what I did:
Connect your PC to your device through USB cable
Download the newest xde from: https://github.com/expo/xde/releases
Install XDE, create a new project from the gui (do NOT use your old project from create-react-app, as it may also show up in XDE) and click the newly created (in XDE) project under "My Projects".
Now your project should show up in the Expo app on your phone. If it doesn't try sending yourself the link to your app over email (to your own inbox, and open the link on your phone), mine looks like this: exp://5c-gp9.[accountname].my-new-project.exp.direct:80
I had this problem when my phone was connected via wifi and my destop was connected via LAN. I changed the connection mode in the browser window to tunnel, reloaded the expo app and was able to connect to my application. This was on my iOS device.
I got this issue on Win 10 with android and solved by the adding a firewall rule for my device (device IP as remote). I was using ESET NOD antivirus and it was block the device from accessing node.exe
for local testing e.g comnputer , simulator
expo start
for Real mobile device
expo start --tunnel
I'm on windows 10.
My network was set to public, but it needed to be private - so that it could safely expose devices like printers and in this case the Expo connection.
I went in my Wifi setting and clicked on Private:
If you are using windows 10 do the following. It worked for me
1. Check if your phone and pc are sharing the same router/hotspot/wifi connection. better still you can connect your pc to your phone hotspot.
2. Configure the network you are using as private. you can do so using this link https://www.digitalcitizen.life/how-set-your-networks-location-private-or-public-windows-10/
3. Off your windows defender and any other antivirus. The windows and other antivirus defender acts as a firewall and prevents expo client from working.
It will work I assure you
I was having the same issue, the solution is easy just make a Firewall rule that allows connection from your mobile device to your PC. open port number 19000 and in the IP put your phone IP address then allow the connection TCP/UDP in both directions, and everything will be OK.
Usually, you can edit the Firewall rules through your antivirus installed on your PC.
Careful don't disable your firewall, it will hurt you a lot.
This problem is due to the sdk version of the project is not compatible with the expo go ,so go to app.json of your project and edit to the latest version of sdk