5

I am trying to debug my android application on the emulator using eclipse. However, when the application starts up, this error comes up -

The application is waiting for debugger to attach

and the emulator hangs in that screen forever. When I click on DDMS view or debug view on eclipse, eclipse also hangs.

I have tried all these methods -

  1. adding <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
  2. adding android:debuggable="true"
  3. changing the line ::1 localhost with 127.0.0.1 localhost in host configuration file (C:\Windows\System32\drivers\etc\hosts)
  4. Making sure only 1 instance of eclipse was open
  5. Restarting Eclipse and windows

However, none of the above steps seem to solve the problem for me.

It would be great if someone could help me out with this.

learner2010
  • 4,157
  • 5
  • 43
  • 68

6 Answers6

2

-- Edit -- Sorry missed the part about it being in the emulator (been building/debugging android apps for months and wouldn't touch the emulator with a 10 foot pole after the first few weeks).

For your problem my guess would be that your application's target version doesn't fit with what your emulator is running.

Also try restarting the emulator.

Matt Wolfe
  • 8,924
  • 8
  • 60
  • 77
  • 1
    Yeah, try restarting your phone. – Sagar Hatekar Mar 05 '12 at 21:35
  • Since when is the emulator a phone? – onit Mar 05 '12 at 21:37
  • thanks. but I did check that out and the target version is the same as the emulator version... – learner2010 Mar 06 '12 at 00:19
  • I have similar issue and the message is hang. I cannot click anything. Please help : http://stackoverflow.com/q/40838494/5241603 – K.Sopheak Nov 29 '16 at 03:12
  • 1
    How in the world could anyone accept this as answer???????????????? "For your problem my guess..." and "Also try restarting..." are about as BOGUS a pair of "answers" that I've ever seen.... THIS IS NOT THE ANSWER. DON'T SETTLE FOR IT. – DSlomer64 Sep 20 '17 at 23:25
  • I agree that the OP should at least mention which of those fixed the issue but calm down DSlomer, this question and answer were from over 5 years ago. If you're having a similar problem in 2017 maybe it's something else. In my recent experience I've found one of the following always works: restarting android studio, or uninstalling the app, or restarting the phone/emulator. Lastly you can toggle off and on usb debugging in developer settings. – Matt Wolfe Sep 21 '17 at 19:19
0

If this is happening when using the Intellij IDEAD IDE, make sure that you only have one debugging session open (you can see these sessions in the debug view). I had two of them open and they interfered with each other so that the debugger just did not attach. Deleting one of them and rermaining just the one being used currently solved the problem.

AntonSack
  • 1,021
  • 2
  • 25
  • 47
0

I tried resetting the adb, that didn't work. I am using a real device for debugging, I restarted that, that's didn't work either.

Finally, I restarted my Eclipse, that worked :-)

Adil Malik
  • 6,279
  • 7
  • 48
  • 77
0

"Wait for debugger"in Developer options may have been set.It forces the configured application to get attached to debugger.

Shinoo Goyal
  • 601
  • 8
  • 10
0

If you are using an android device instead of an emulator, restarting it should fix the problem.

Adzz
  • 77
  • 1
  • 6
0

You can also check if your USB Driver is correctly installed and up to date.

Pascal Piché
  • 600
  • 2
  • 13