Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Eclipse failing to debug

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)

`

like image 730
Jesse Avatar asked Apr 04 '11 15:04

Jesse


People also ask

How do I enable debug on APK?

To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.

How do I run Android in debug mode?

Press Ctrl + Alt + F5 (or Shift + F9 ) to launch the app in debug mode. Choose Run -> Attach to process and select the signature of an app to enable the debug mode, which is already installed via adb.

How do I enable debugging in Eclipse?

A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead.


2 Answers

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

like image 69
Killesk Avatar answered Oct 12 '22 22:10

Killesk


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.

like image 8
Sam Avatar answered Oct 12 '22 23:10

Sam