How to fix java.net.UnknownHostException on Android

Read Time:21 Second

Original Article: http://jesper.storm-frandsen.dk/pages/How_to_fix_java.net.UnknownHostException_on_Android.php

Start the emunator manually with the following command. The trick worked for me, when everything else did not work.

C:\android\tools>emulator -avd Legend78 -dns-server 8.8.8.8

The IP address 8.8.8.8 is google-public-dns-a.google.com

Or configure Eclipse in the Run or Debug configuration.

Android DNS fix

3 thoughts on “How to fix java.net.UnknownHostException on Android

  1. I couldn’t get rid of the emulator “UnknownHostExceptions”. Tried everything. Finally I deleted my AVD, shut down Eclipse, and then created the AVD via the command line. Then launched it with your -dns-server option. It finally worked!

    Thanks for the help.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: