Debugging with Android Studio stuck at “Waiting For Debugger” forever

前端 未结 29 2230
甜味超标
甜味超标 2020-12-04 08:36

UPDATE The supposed duplicate is a question on being stucking in \"Waiting For Debugger\" when executing Run, while this

相关标签:
29条回答
  • 2020-12-04 09:17

    For me Run->Attach debugger to Android process was working, but I had to do it every time app was launched.

    Fix: There may be a problem with your 'App launch configuration'(To verify this create new project to see if it's working fine). Just delete app configuration, open MainActivity file and Run->Debug (new conffiguration will be created)

    0 讨论(0)
  • 2020-12-04 09:18

    Got it fixed according this solution: https://youtrack.jetbrains.com/issue/IDEA-166153
    I opened <project dir>/.idea/workspace.xml replaced all the
    <option name="DEBUGGER_TYPE" value="Auto" /> occurrences to
    <option name="DEBUGGER_TYPE" value="Java" />
    and restarted Android Studio

    0 讨论(0)
  • 2020-12-04 09:20

    Well, I guess there is a plethora of circumstances that can trigger this issue. I'm using IntelliJ Idea instead, but it's mostly the same than Android Studio. My solution for this problem:

    Fastest way:

    Right click on the class file that contains the main activity of your project, and then on "Debug 'WhateverActivity'". This will create a new run configuration that should debug fine.

    Other solution, without creating a new run configuration:

    1. Open Run/Debug configurations and within "Android app" pick the configuration you're using to debug your app.
    2. Locate "Launch Options/Launch" there and set it to "Specified Activity" instead of "Default Activity".
    3. In the "Launch" field just below the aforementioned option, click on the three ellipsis (three dots) button and select your main activity.

    At least it worked for me. I hope it works for others too.

    0 讨论(0)
  • 2020-12-04 09:24

    Debugger stopped connecting for me today and nothing worked until I tried the following:

    Go to Run, Edit-Configurations, Miscellaneous Tab, uncheck 'skip installation if APK has not changed' Apply, OK.

    Debugger started to connect again.

    0 讨论(0)
  • 2020-12-04 09:24

    This problem occurs when you open more than one instance of Android studio, so you need to attach the debugger manually like mentioned above.

    You may need to close other instances of Android studio.

    0 讨论(0)
  • 2020-12-04 09:24

    Most of the times this is caused because of the overload of resources and threads over the emulator. Or even for the lock of objects that GC couldn't set free: http://developer.android.com/intl/pt-br/tools/debugging/index.html

    Usually, a single restart of it will solve the issue, but sometimes it asks for the IDE restart, so be sure to make both tests.

    Another good test is trying to start the app in "Start mode" and then try the debug mode again...

    P.S: Don't forget to kill each debug process in the IDE after each test. This will prevent your env to be more overloaded.

    0 讨论(0)
提交回复
热议问题