简体   繁体   中英

Application is waiting for debugger to attach

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.

-- 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.

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.

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 :-)

开发人员选项中的“等待调试器”可能已设置。它强制配置的应用程序附加到调试器。

如果您使用的是 android 设备而不是模拟器,重新启动它应该可以解决问题。

您还可以检查您的 USB 驱动程序是否正确安装并且是最新的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM