可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I've created an expo app with exp init MyApp
command and started it by running exp start
in MyApp
directory.
Then I'm scanning barcode which was printed in console with expo mobile app on android device.
Then "Something went wrong" screen is rendered instead of the app.
View log shows "Uncaught Error: Couldn't load exp://.....".
No errors in expo
packager console output.
It used to work sometimes ago.
回答1:
For me the problem was happening when running over WiFi, as the tools always use the your first connection (you can check it by running ipconfig
) and my first connection was internet.
If that's you case you may try this workaround for changing you connections priority:
- Go to Control Panel > Network and Internet > Network Connections
- Right click the desired connection (Higher Priority Connection)
- Click Properties > Internet Protocol Version 4
- Click Properties > Advanced
- Uncheck 'Automatic Metric'
- Enter 10 in 'Interface Metric'
- Click OK
回答2:
In my case, I had "host" set to 'localhost' in the XDE - which of course won't work on my physical device ;-) So, if you want to debug on a physical device, make sure your host is set to LAN instead. (Tunnel would work too, but would make debugging painstakingly slow)
回答3:
It was needed to reset "Draw over other apps" permission for Expo
mobile app.
How that is fixed on Android 6.
Settings->Apps, press "gear", find "Draw over other apps" item and select it. Find "Expo" app, select it. Enable "Permit drawing over other apps" option in case it is disabled. Otherwise, disable and enable it again.
回答4:
In my case, expo app was outdated. I just updated expo from store and it started working.
回答5:
I had the same problem and fixed it on Windows 10 by making my machine discoverable on the network:
- Click wifi icon in app drawer.
- Go to the list of wifi connections and click your connection.
- Click "Properties". This opens up the page associated with your connection.
- Under "Make this PC discoverable", turn the slider to "On".
回答6:
For me, I have to close and kill expo (from RAM) AND close the QR Code overlay view to get it work on Android 5.1.1.
Sometimes I have to wait a few minutes or I get a camera view and a text above about scanning the QR Code (but without a scanner over the camera view).
回答7:
In my case, the issue was fixed by doing the following on my Android (Galaxy Note 5):
- Go to Settings > Apps > Application Manager > Expo
- Scroll down to Draw over other apps and toggle it off and then on again
- Close out of everything, re-open expo, and try connecting
It still threw an issue once before working perfectly upon further tries.
回答8:
For my case, using wireless adapter, I had to make my Network profile private. 1) Go to Properties of wireless network 2) Make network profile private
回答9:
I believe this issue is happening due to mismatch version of your AVD and your expo mobile application. I created new AVD with newer version of Nexus 6 API and issue was resolved. I also needed to reset "Draw over other apps" permission for Expo mobile app.