I have a server on my computer running on localhost:8080
, previously I was able to access this in the Android emulator under 10.0.2.2:8080
and it worked great. I went to load it again at some point today and it no longer works. No configuration has changed to my knowledge.
I can still access localhost when I use a browser on my computer, so the server is still running okay. But on the emulator, whether using my app or a browser it will not connect.
Any suggestions would be appreciated. Thanks.
In case anyone comes across this in a search, this is how I fixed the problem:
sudo nano /private/etc/hosts
::1 localhost
Restarted my local server and after that it worked.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.