简体   繁体   中英

Android Studio 2.3.3; I can NOT DEBUG; hangs with “waiting for the debugger to attach” and “waiting for debugger response”

The past two days, for the first time in 3 years of using AS, I've been getting “waiting for the debugger to attach” and "waiting for debugger response" messages. The debugger isn't attaching or responding because it's hung.

It's that simple.

And as of an hour ago, stopping and restarting debugging from the Run menu no longer results in a debuggable process. NOTHING CAN BE DEBUGGED. And every time I do Run Stop, I get "waiting for debugger response." SURELY that tells Google SOMEthing.

I inadvertently had left an app in this hung state and went to a two-hour meeting. When I got back, Debug was still not responding to keypresses or mouse clicks. So I clicked Run Stop and immediately got the message "waiting for debugger response". I guess it would stay in this hung state until there was a stack overflow.

This is even happening with my PHONE. Problem not limited to emulators.

There are PLENTY of "Answers" to similar questions, BUT NOT ONE ANSWER IS A REAL SOLUTION ANYWHERE that I've looked. Just "restart AS" or "restart AS AND the emulator" or "upgrade" or "delete .idea folder for your project". Of course none of this works because IT'S GOOGLE'S PROBLEM.

No Gradle errors. Console's clean. So's terminal and event log.

Possibly related, I've been getting several "IDE errors" daily. I report each to Google.

Also today, in the Run menu, Debug was grayed out and Debug tab was missing. I clicked Run Debug and that problem went away. Whatever.

How do I fix "waiting for debugger to attach" and "waiting for debugger response" so I can debug again?


EDIT

Here's a telling bit I think:

在此处输入图片说明

It's said Collecting data... for a looooooooooooong time with the cursor at the first break point. Guess what happened when I hit F8. "Waiting for Debugger response."

Can you make anything out of this NOW?

EDIT

Well, this was just as effective as every other "Answer" that ANYBODY has ever put forth. In short, after upgrade, problem's back. So ignore all the crap below. I tried. I hoped. I failed.

But NOW WHAT?????????????????????????????????

I've read that AS isn't compatible with Java 1.8, of course AFTER upgrading to 1.8 and there's no way at java.com to go back. What an effing CROCK.


Well, this actually could be a fix that would work in any situation.

Apply updates. Here are initial messages from update manager, telling what's going to be done:

To install:
- Android SDK Tools (tools)
- Intel x86 Emulator Accelerator (HAXM installer) (extras;intel;Hardware_Accelerated_Execution_Manager)
- Google APIs Intel x86 Atom System Image (system-images;android-22;google_apis;x86)
- Android TV Intel x86 Atom System Image (system-images;android-23;android-tv;x86)
- Android TV ARM EABI v7a System Image (system-images;android-23;android-tv;armeabi-v7a)
- Google Repository (extras;google;m2repository)
- Google Play services (extras;google;google_play_services)
- Android TV Intel x86 Atom System Image (system-images;android-24;android-tv;x86)

After the update, I find this in Tools SDK Manager:

在此处输入图片说明

Whatever "Partially installed" means--ie, good, ok, or bad--I'm doing nothing, since right now I'm able to debug.

Every other Answer I came across said, in sum, "change things until one of the changes gets you past the error: therefore, since it worked for me, you should try it," but don't get your hopes up. At best those suggestions amount to refreshing AS, changing little. Upgrading, on the other hand, shouldn't have taken three days of ignoring the message for me to do so.

Please note that all the other "Answers" (often, none accepted) tell you to restart AS, reinstall AS, delete.idea folder for your project, attach debugger to Android process (bottom of Run menu; my "OK" button is grayed out), and other things that don't do much except (if they worked) jolt AS back into focus. They sure don't change the software, though; problem likely will recur IMHO. But updating sure does change the software, which is definitely at fault with such errors as these.

I had the same problem with AS 3.0, but only with Oreo 8.0 virtual device (haven't tried on real device though). On older Android versions including Nougat 7.1 debugger was able to attach to the process running on the emulator. The reason was I had build version set to release instead of debug. When I changed it to debug (Build versions tab is on the bottom of the left toolbar), I was able to debug the app on Oreo 8.0 as well. Hope this helps.

I know this question is really old, but I had the same problem last week and it did cost me 5 hours of my life to fix it. After restarting, invalidating caches, re-installing the IDE, confirming that the problem occured only in one single project, deleting a suspicous external library, reverting to old commits...I found out that git cloning the project again was the only thing that helped. No Idea what happened in that git repo, but that fixed the problem.

TL;DR: Try cloning the project again.

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