5

Possible Duplicate:
Eclipse Error: “Failed to connect to remote VM”

I am using Eclipse to dip my toe into Android development. All going well but recently, I am not able to use debug anymore. When I click 'Debug As' - 'Android Application', app builds ok, installs ok but Android device (either actual device or emulator, it makes no difference) waits with 'Waiting For Debugger' with a single 'Force Close' button. In the console, I get something like:-

[2011-08-26 11:59:59 - Sunrise] Starting activity com.sr.sunrise.Sunrise on device 3833CB14F52C00EC [2011-08-26 11:59:59 - Sunrise] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sr.sunrise/.Sunrise } [2011-08-26 12:00:00 - Sunrise] Attempting to connect debugger to 'com.sr.sunrise' on port 8614 [2011-08-26 12:00:00 - Sunrise] Launch error: Failed to connect to remote VM

I have followed many searches (including this one StackOverflow.com link and this StackOverflow.com link2

and I have tried many suggestions but nothing has fixed this problem yet.

Can anyone help me as this is now stopping me from creating my masterpiece ;-)

Community
  • 1
  • 1
Paul Goodwin
  • 51
  • 1
  • 1
  • 2
  • Try to first create a different virtual machine in the Android SDK Manager and see if the problem persists. And it may sound stupid, but check to see that under Settings->Application->Development on the Android emulator the the ENable USB Debugging is enabled (and it should be by all means). – Bob Aug 27 '11 at 19:24
  • Hi Bob, thanks for this. I have just added a – Paul Goodwin Aug 30 '11 at 12:30
  • 1
    Hi @bob, thanks for this. I have just added a new VM and the problem is the same. Also, USB debugging is enabled. Seems I'm not the only person seeing this issue. I'm pulling my hair out with this one. I have tried to telnet into the debugger's port (8618) and this works ok – Paul Goodwin Aug 30 '11 at 13:39
  • I'm just assuming here, but your project still runs without trying to debug correct? Well anyway, heres another shot at this. Try to switch the base debugging port to 8700 (you can find that in Preferences->Android->DDMS) If that still doesn't help, try to increase the timeout. Mine is actually like 15000 cause I have had issues in the past with uploading my project (this answer seems less likely so I'm putting it second) Lastly have you tried some things here on this page? http://developer.android.com/guide/developing/debugging/ddms.html Its a good read! – Bob Aug 31 '11 at 01:19
  • Hi @bob, Yep, the project runs on emulator (or device) if I tell it to 'Run As' instead of 'Debug As'. I have just changed default port to 8700 and increased timeout as suggested to 15000 but the error is still the same. Note, on the device (or emulator) screen, it says 'Waiting for DeBugger Application xxxxxx is waiting for the debugger to attach.' with a 'Force Close' button my only option. Thanks for the link, I'll read through that later – Paul Goodwin Aug 31 '11 at 16:25
  • Unfortunately, I can not answer here anymore (duplicate???). I had the same problem just now and the only fix was to restart the Android device and my Dev system (stock Nexus7/4.3 & Ubuntu/SDK18.0.1). – Max Hille Aug 07 '13 at 08:08
  • reset ADB in DDMS will fix this. – hemanth kumar Nov 23 '15 at 09:54

2 Answers2

13

This just worked for me:

  1. Close Eclipse.
  2. Remove USB.
  3. Go to task manager, and delete all 'eclipse.exe' (in my case I had 4-5 instances).
  4. Also delete 'adb.exe'.
  5. Restart Eclipse.
  6. Reconnect USB.

Maybe this will work for others who have the same problem.

gosr
  • 4,593
  • 9
  • 46
  • 82
2

THIS IS PRETTY MUCH THE NUCLEAR OPTION...

I had the same problem on my macbookpro, I don't know exactly how to fix it data loss, but on my system, I "rm -r ~/.android", recreated my devices, and I can again debug.

It is important to note that this is destructive in that the .android directory is where the android emulator is saving the state of the devices I am emulating.

I think the root cause of the problem had something to do with an old android SDK that I removed from my system when I downloaded the android-sdk_r15-macosx.zip leaving some cruft around in the .android directory.

Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
  • Well this worked...for a day. A couple of "Cleans..." in Eclipse later and update of an Andriod Service APK, Application APK, and new Library and I again cannot get the Debugger to connect. QWalilitY – Bob Kuhar Nov 17 '11 at 00:15
  • This worked for me as well, when nothing else I tried (Rebooting phone/computer, new workspace, killing adb, etc) did anything. – mbafford Mar 14 '12 at 20:07