Scanning Error Expo: Network response time out - react-native

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

Related

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.

The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. I want to generate apk

I am using expo-cli#3.0.10
This app works fine in client expo which installed in device
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.
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,
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.
You need to start expo server first. Use expo start. Then run your project.
After starting your expo server re-start your project.

react native expo launch app time out

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

Using react native build on device red screen is coming .Android error “Could not connect to the server” on start of app.

I am new in react native language first time run the build on the physical device the red screen is comming how to resolve this
It may be a bundle error.
You can run command react-native-start. Then open this link in browser
http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false
It will bundle the package with development server.
or It may be an issue with adb not running
Only applicable for physical mobile device
incase you are still our of luck ... follow these steps
usually its port forwarding which causes this
so ensure you have already executed
adb reverse tcp:5000 tcp:6000
(OVER here your port number can be same or different depending upon how do you run your program, in my case i keep both of the same)
And if your issue is solved.
identify your machine ip address
goto mobile device (ensure wifi is turned on and you are on same network)
open any browser and see whether your ip is accessible by using following url
{ip address}:{port}
Example: 10.98.1.1:9001
If you see page can't be displayed, Do following -
Still run the application on device which will show red color error screen
Shake the device
Goto Dev settings
Open Debug server host & port for device
Enter
localhost:{port number} instead of ip address
You are done.

can't able to run react-native app in Android device

hai every one i am trying to run the react-native android app in device then it throws an error like as mentioned below
can any one please give me suggestions for how to solve this error,Any help much appreciated
Try following the steps on the guide page.
You may have to set the address of your dev server.
Configure your app to connect to the local dev server via Wi-Fi
Make sure your laptop and your phone are on the same Wi-Fi network.
Open your React Native app on your device. You can do this the same way you'd open any other app.
You'll see a red screen with an error. This is OK. The following steps will fix that.
Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
Go to Dev Settings.
Go to Debug server host for device.
Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
Go back to the Developer menu and select Reload JS.