I have created a project using Expo XDE. I checked this Can't load expo app: Something went wrong but I have already enabled "Draw over other apps". It works https://expo.io/@ajaysaini/first-proj when I scan this QR code but it doesn't when I run it on android device from XDE.
main.js
import Expo from 'expo';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Updating!</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Expo.registerRootComponent(App);
When I am running it on device it shows below error on android device. I tried restart in XDE multiple times but it didn't help me.
Dependency graph loaded.
11:19:21 AM
Starting React Native packager...
11:19:24 AM
Scanning 528 folders for symlinks in D:\Expo\first-proj\first-proj\node_modules (18ms)
11:19:24 AM
Loading dependency graph.
11:19:24 AM
Running packager on port 19001.
11:19:25 AM
11:19:33 AM
Project opened! You can now use the "Share" or "Device" buttons to view your project.
11:19:44 AM
Opening on Android device
11:19:54 AM
Dependency graph loaded.
11:21:41 AM
Opening on Android device
11:23:31 AM
Opening on Android device
Error:
There was an unhandled error: Could not load exp://
Stack Trace:
Can anyone help me what is going wrong ?
You better open XDE Client and enable development mode. Then, click on the gray cog to make Host > LAN (Local area network - which means sharing packages over WiFi with a real device).
Localhost option may work as well but according to Expo Debugging docs:
If you are using LAN, make sure your device is on the same wifi network as your development machine. This may not work on some public networks. localhost will not work for iOS unless you are in the simulator, and it only works on Android if your device is connected to your machine via USB.
Also, here is a visual informative answer that I wrote a few months ago that may also help: How do I run an app on a real iOS device using Expo?
I encountered the same problem and none of the solutions worked for me. The problem here is that Expo shows the wrong IP address which your phone can't connect to.
This is how I worked around it. I'm going to assume that you're on windows and using LAN to run the app on your device.
- Open cmd, type
ipconfigand find out your local IP. It should be listed asIPv4 Addressunder theWireless LAN Adaptersection. It will look something like192.168.xx.x - Now open any text editor in your phone and type
exp://192.168.xx.x:19000. Copy this text to your clipboard. - Open Expo app. You will now see the
Open from Clipboardoption on the top. Press it and your app should load.
Now anytime you want to load an app, you can copy the same address and open it in Expo.
There's another simpler workaround I found. Run the command
set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.xx.xbeforeexpo start. This will set the correct IP in Expo Dev Tools.
Hope this helps.
Sometimes the problem is due to using a wrong network adapter priority.
open the terminal and run
ipconfig
if your main LAN adapter is not listed as the first adapter, then changing the adapter priority may solve the problem. Just follow the steps:
Goto Control Panel > Network and Internet > Network Connections
Right click your main LAN
Click Properties > Internet Protocol Version 4
Click Properties > Advanced
Uncheck 'Automatic Metric'
Enter 10 in 'Interface Metric'
Click OK
I guess a lot of people must have done all the above and still have Something went wrong error
The docs might have specify when building locally and your device is connected to your machine you should click on the Local section on web debug page which shows the QRcode image.
Then after clicking on Local, try to scan the QRcode once again your error should disappear and shows a loading bundling javascripts assets.
Assumptions: Installed Expo (https://expo.io) on Computer via NPM/Yarn and installed Expo on Android/iPhone. Also, Phone is on the same wifi network as Computer.
My Computer was connected via WiFI, and this was the problem for me. Windows: Commandline: $ ipconfig Find Wifi IP Address of your Computer. Mine was Ip v4 : 192.168.1.xxx Type in the web browser on the Phones web Browser URL : exp://192.168.1.xxx:19000 Then should see some text, which means the phone is connecting via the Network (good sign) Then open expo on Phone, and should see link via Clipboard. Click on Link via Clipboard which is inside the Expo program on the phone. Then it should load the App on your phone. This worked for me. P.s Follow instructions for giving Expo permission etc when it works for the first time.
I solved the same problem with recomendation from React Native team - to instal and run Genymotion software::
- Install Genymotion with VirtualBox
- SignUp at Genymotion site
- Run Genymotion software and !!!SignIn
- Close npm prompt program with project and start it again
- npm start (in the npm promt window in the project directory)
- Close and start Expo app, scan barcode
If my application runs successfully IpV addresses are identical, for example:
exp://10.0.0.125:19000 and
ipconfig -> IPv4 Address. . . . . . . . . . . : 10.0.0.125
If anyone is having a similar problem, my issue had to do withasking to allow node.js to connect with the network appeared, and it worked.
for some reason I was creating conflicts with docker, I disabled it and it worked without problems, I'm almost sure it's hyper-V
Maybe this might be helpful to simply explain that, such an error occurs if your phone and your computer are on different networks.
I resolved this issue by tethering and that way, my two devices were not on the same network.
Which means probably you can connect both your devices to the same WiFi it should work.
In my case it was VPN - I have connected my mobile with VPN after disconnect it loaded successfully !
In case you guys use firewall, make sure ports 19000 and 19001 are whitelisted.
Ensure that your laptop and android device is connected to the same network and that should fix the issue, as it just did for me.
I fixed my issue by update npm and node ..
来源:https://stackoverflow.com/questions/44644952/could-not-load-exp-something-went-wrong


