问题
I have a problem, when I want to start developing applications for android, I did everything like in manual here but after installing ADT Plugin in Eclipse I am still getting this error :
[2011-12-29 14:34:56 - ddms] Failed to initialize Monitor Thread: Unable to establish loopback connection
then, if I try to run an application this appear :
[2011-12-29 14:41:42 - TestApp] ------------------------------ [2011-12-29 14:41:42 - TestApp] Android Launch! [2011-12-29 14:41:42 - TestApp] Connection with adb was interrupted. [2011-12-29 14:41:42 - TestApp] 0 attempts have been made to reconnect. [2011-12-29 14:41:42 - TestApp] You may want to manually restart adb from the Devices view.
回答1:
No need to turn off tredo interface:
simply add -Djava.net.preferIPv4Stack=true
in eclipse.ini
:
openFile
-vmargs
-Djava.net.preferIPv4Stack=true
回答2:
The solution is simple : turn off Teredo Tunneling Pseudo-Interface.
This probably converts IP4 to IPv6 addresses or something, resulting in an IPv6 address for your localhost (strange though, that a PING still results in IP4). Anyway, turning it off (Device manager > View > Show hidden devices > right click on Teredo > disable) solves the problem!
I found out by doing a ipconfig /all
in the NON working situation. It showed :
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fb:####:###:####:####(Preferred)
Link-local IPv6 Address . . . . . : fe80::3c47:###:####:#### (Preferred)
来源:https://stackoverflow.com/questions/8668601/failed-to-initialize-monitor-thread-unable-to-establish-loopback-connection-a