David Citron is right - if the local host does not resolve correctly, this may cause this problem. Here's how to check:
If it works when your computer is not connected to the network (no Wi-Fi, no network cables). If it works under these conditions, you may need to make sure that the addresses match localhost correctly. Messages that DDMS and adb.exe use to debug and communicate with the virtual machine must correctly resolve to localhost on your PC. (Yes, it’s strange that other commands using DDMS and adb work fine, but it doesn’t do debugging. It seems that something in DDMS or adb needs to be standardized so that they all work under the same conditions.)
If you need to make sure the localhost solution is correct:
1) Make sure this line is in the file /Windows/System32/drivers/etc/hosts :
127.0.0.1 localhost
(you can have any number of spaces between "127.0.0.1" and "localhost")
And - as David Citron suggested - make sure the hosts file is valid and free from errors or errors.
2) If this does not work, you may also need to add the IPv4 address of your computer to the hosts file and allow it localhost . (You can find out the IPv4 address for your computer using the ipconfig command.) If, for example, your IPv4 computer address is 192.168.1.100 , you must add the line
192.168.1.100 localhost
to your hosts file. (You can add it under the line "127.0.0.1 localhost" in the file.)
You can verify that adb (and your emulator, if you use it) is listening on ports using the netstat -b command. (Note that you need administrator privileges for the -b option. I open the command window using the "Run as administrator" command.)
aenw Jul 13 '12 at 3:10 2012-07-13 03:10
source share