How to prevent Android Studio / AVD "CANNOT TRANSLATE guest DNS ip" error messages?

Android StudioAvd

Android Studio Problem Overview


About every 4 second after I start the emulator device from my Android Studio project an error message is printed into the Run window. It's extremely annoying because it hijacks the focus. If I'm in the Debug window it switches to the Run window every 4 seconds because of this error no matter what I do.

This started a day ago, but I don't know what induced it. I use the same emulator devices for several months now. Maybe an upgrade of some portion of Android SDK? The external SDK Manager is not invokable any more.

enter image description here


The messages start to come right after I boot up this API 25 wear emulator. One workaround is to make that tab float, then it doesn't hijack my focus; I move it to my second monitor.


I also noticed I cannot connect my Android Wear app running on my physical device (I'm running physical phone with the emulated wear) with my emulator.

Android Studio Solutions


Solution 1 - Android Studio

It is because you are connect to a network which has a auto-redirect in it or it is not encrypted(HTTP). Start by

  1. Disconnecting yourself from the network.
  2. Restarting Android Studio

If the problem continues try posting a more detailed description of the error If the problem doesn't continue contact your network administrator.

Solution 2 - Android Studio

Maybe this can help:

  • Please make sure that you are connected to internet

Explanation: At startup, the emulator reads the list of DNS servers that your system is currently using. It then stores the IP addresses of up to four servers on this list and set up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4, 10.0.2.5 and 10.0.2.6 as needed. So, it needs internet connection to deal with them.

When starting the emulator at the command line, you can also use the -dns-server option to manually specify the addresses of DNS servers to use, where serverList is a comma-separated list of server names or IP addresses.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCsaba TothView Question on Stackoverflow
Solution 1 - Android StudioPranav BhaskarView Answer on Stackoverflow
Solution 2 - Android StudioDekel LaiferView Answer on Stackoverflow