Using Android Studio on Windows 8 x64 (latest stable build). I have an extremely simple project with nothing but a WebView pointed to google.com but everytime I launch the app in the emulator, I get ERR_NAME_NOT_RESOLVED.
I've made sure the INTERNET permission is in the manifest, I tried passing the -dns-server flag to the emulator pointing it to 127.0.0.1 as well as my router's IP, nothing works. I've scoured the web and found nothing, which seems suspicious. This is a relatively simple thing that I expected to work right out of the box.
Any ideas? Thanks in advance!
By disabling my NIC, I was able to get the emulator to use my Wifi connection. Answer found here: https://stackoverflow.com/a/2702663/568531
我有一个解决方案,这对我来说是不可理解的,但它的工作原理是:当模拟器具有startet时,我会连接并连接我的笔记本电脑,然后它就可以工作了。
Provided you've given access to internet in manifest.xml, and still emulator can't access internet, this solution worked for me on windows 7:
Click Start -->Run, type in cmd, press OK. Copy and paste this into the Command prompt: netsh winsock reset catalog Press Enter Then copy and paste this in: netsh int ip reset reset.log Press Enter. When finished restart your computer.
My solution was simply to restart the emulator. Sometimes it is not a real problem in the app but a problem of the emulator.
I encounter this issue when I first run the simulator, I solved it by,
Library/Android/sdk/platform-tools/adb shell getprop net.dns1
get the current dns server of simulator 10.0.2.3
Then set it to my lan dns server
Library/Android/sdk/platform-tools/adb shell setprop net.dns1 192.168.1.1
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.