Android Studio / Win8 / ERR_NAME_NOT_RESOLVED
Asked Answered
S

5

8

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!

Strobe answered 25/7, 2014 at 3:5 Comment(0)
S
6

By disabling my NIC, I was able to get the emulator to use my Wifi connection. Answer found here: https://mcmap.net/q/35826/-how-to-connect-android-emulator-to-the-internet

Strobe answered 25/7, 2014 at 3:25 Comment(1)
Not directly related to your problem, but I would recommend using Genymotion instead of the AVD emulator in Android Studio. It is much faster and avoids a lot of hassles.Malchy
O
1

i have a solution, that isn't understandble for me, but it works: When the emulator has startet, i diconnect and connect my notebook wlan, and then it works.

Opalina answered 17/2, 2015 at 20:22 Comment(1)
Ok, I don't know why, but it worked for me too!! My phone was no more able to open the Facebook login dialog from my app. After disabling the wifi, it worked!! What the hellStringy
T
0

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.

Trotline answered 31/12, 2015 at 6:18 Comment(0)
L
0

My solution was simply to restart the emulator. Sometimes it is not a real problem in the app but a problem of the emulator.

Long answered 30/3, 2016 at 7:28 Comment(0)
R
0

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
Rowel answered 12/7, 2017 at 7:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.