Android Eclipse failing to debug

19,401

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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.

Solution 5

On your Android device (or emulator) go to:

Applications - Settings - Applications - Manage applications - All

There you have to select your app and uninstall it.

Afterwards try to run your app from the IDE again. It should work now.

Share:
19,401

Related videos on Youtube

Jesse
Author by

Jesse

Updated on August 05, 2020

Comments

  • Jesse
    Jesse over 3 years

    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. When I hit debug or run the app starts up and right when it is about to display the app, it crashes (before even entering the main view). I have a break point on the first line of code and it never even reaches it. It just goes to Source not found - The source attachment does not contains the source for the file DexFile.class..... I am 100% certain all the code I have loaded is working, as it is a saved backup which was saved when last working.

    Also, what is odd is that if I unplug the cable at this point, the app loads normally and works fine. So this is definitely a debugging issue. It is getting stuck somewhere at boot. I have restarted my computer and phone several times to no avail.

    LogCat:
    `04-04 11:17:33.462: DEBUG/AndroidRuntime(4148): CheckJNI is OFF
    04-04 11:17:33.462: DEBUG/dalvikvm(4148): creating instr width table
    04-04 11:17:33.502: DEBUG/AndroidRuntime(4148): --- registering native functions ---
    04-04 11:17:33.712: DEBUG/AndroidRuntime(4148): Shutting down VM
    04-04 11:17:33.712: DEBUG/dalvikvm(4148): Debugger has detached; object registry had 1 entries
    04-04 11:17:33.712: INFO/AndroidRuntime(4148): NOTE: attach of thread 'Binder Thread #3' failed
    04-04 11:17:33.902: DEBUG/AndroidRuntime(4157): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    04-04 11:17:33.902: DEBUG/AndroidRuntime(4157): CheckJNI is OFF
    04-04 11:17:33.902: DEBUG/dalvikvm(4157): creating instr width table
    04-04 11:17:33.942: DEBUG/AndroidRuntime(4157): --- registering native functions ---
    04-04 11:17:34.152: INFO/Process(107): Sending signal. PID: 4137 SIG: 9
    04-04 11:17:34.152: INFO/ActivityManager(107): Force stopping package org.scanner uid=10110
    04-04 11:17:34.162: ERROR/ActivityManager(107): fail to set top app changed!
    04-04 11:17:34.182: INFO/UsageStats(107): Unexpected resume of com.htc.launcher while already resumed in org.scanner
    04-04 11:17:34.192: INFO/ActivityManager(107): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.obdscanner/.activity.ObdReaderMainActivity }
    04-04 11:17:34.202: DEBUG/AndroidRuntime(4157): Shutting down VM
    04-04 11:17:34.202: DEBUG/dalvikvm(4157): Debugger has detached; object registry had 1 entries
    04-04 11:17:34.212: INFO/AndroidRuntime(4157): NOTE: attach of thread 'Binder Thread #3' failed
    04-04 11:17:34.222: WARN/InputManagerService(107): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@464105d8
    04-04 11:17:34.242: INFO/ActivityManager(107): Start proc org.scanner for activity org.obdscanner/.activity.ReaderMainActivity: pid=4165 uid=10110 gids={3003, 3002}
    04-04 11:17:34.332: WARN/ActivityThread(4165): Application org.scanner is waiting for the debugger on port 8100...
    04-04 11:17:34.332: INFO/System.out(4165): Sending WAIT chunk
    04-04 11:17:34.352: INFO/dalvikvm(4165): Debugger is active
    04-04 11:17:34.472: DEBUG/Norton Community Watch/smrsd(3910): smrsd broadcast intent success!
    04-04 11:17:34.512: ERROR/(3910): /data/data/com.symantec.monitor/app_log_item/1301930254.txt//data/data/com.symantec.monitor/app_log_item
    04-04 11:17:34.542: INFO/System.out(4165): Debugger has connected
    04-04 11:17:34.542: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:34.632: INFO/global(3898): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
    04-04 11:17:34.742: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:34.862: DEBUG/dalvikvm(3898): GC_FOR_MALLOC freed 4492 objects / 274560 bytes in 41ms
    04-04 11:17:34.942: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:35.142: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:35.342: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:35.552: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:35.752: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:35.952: INFO/System.out(4165): waiting for debugger to settle...
    04-04 11:17:36.157: INFO/System.out(4165): debugger has settled (1451)
    04-04 11:17:37.296: DEBUG/dalvikvm(4165): threadid=1: still suspended after undo (sc=1 dc=1 s=Y)
    

    `

    • Jesse
      Jesse almost 13 years
      SOLVED! 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. All is good now. Very strange, especially since PC reboot and phone reboots didnt even solve the issue. Crazy that simply removing the app from package explorer and added it back did the trick.
    • Heiko Rupp
      Heiko Rupp over 12 years
      @Jesse: Would you mind posting your solution as answer to your question (you may even later accept it), so that a) it no longer lingers as open question and b) other users may learn from it as well.
    • Nick
      Nick about 12 years
      @Jesse I second Heiko's comment. Your solution worked for me and I nearly left the page without noticing it after neither answer did it for me. Thanks either way

Related