Android Eclipse failing to debug

后端 未结 8 1725
北海茫月
北海茫月 2020-12-10 01:41

Debugging of my app is now suddenly broken. It has been fine up to now and I even reloaded a known good version of my entire code and it still fails to debug or even run.

相关标签:
8条回答
  • 2020-12-10 02:12

    I know this is kind of late.... use it if @Sam's or @Killesk's answers do not work.

    1. ensure the manifest sets android:debuggable.

    2. In onCreate, add a call to Debug.waitForDebugger.

    Adding the call to waitForDebugger also works when reversing. For example you can add the following by hand in onCreate and have smali/baksmali recompile it:

    invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
    

    I don't have to use the tricks often, but when I do, waitForDebugger always works. I don't recall a time I could not snap the debugger with it.

    0 讨论(0)
  • 2020-12-10 02:15

    Strange solution...I just closed the project from package explorer, then removed it from the workspace. Closed Eclipse. Re-opened Eclipse and imported the project.

    (Copy and pasted from Jesse's comment.)

    0 讨论(0)
  • 2020-12-10 02:20

    I tried all of the above, but i turned out that it was not working due to multiple instances of eclipse.exe Killing them all in the task manager (CTRL+SHIFT+ESC) solved it.

    0 讨论(0)
  • 2020-12-10 02:26

    Please see the correct annswer HERE

    You have set a break point in one of the classes. Just take off all the break points in your project and run again, their will be no problem.

    Eclipse->Window->Show View->(Other->Debug->)Breakpoints

    0 讨论(0)
  • 2020-12-10 02:28

    I've had this happen due to my code being obfuscated. I didn't notice that someone had changed proguard.cfg for a production release and commented-out the "-dontobfuscate" line.

    0 讨论(0)
  • 2020-12-10 02:29

    Occasionally Eclipse and the various Android development plug-ins will become out of sync. I usually attempt the following when debugging / development gets "funky"

    1. If your Logcat is not displaying lines, clear it. It has a small buffer. Also ensure that your device is selected in the "DDMS" perspective. If you have the emulator selected you will only receive logging from it.
    2. Clean and Rebuild all open projects. Ensure there are no errors.
    3. Uninstall the application from the remote device/emulator.
    4. Restart Eclipse!
    5. Open a terminal on your platform and use the tool adb in the "platform-tools" directory.

      adb kill-server
      adb start-server
      
    6. Stash your working copy and revert your source code if using a repository.

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