Reputation: 5594
I've been lazy with debugging for the past couple of years with easy school projects and have just used print commands to see what was going on in my programs, but now I'm working with something more sophisticated where that just won't do, and I've found that I've forgotten how to debug.
I was getting the message "android.jar has no source attachment" when stepping into just about every other line of my code. I decided to backtrack and try to "debug" a working app of mine just to see how it works, and got the same message.
I've never used logcat before either and am not sure that I'm doing it right or what stuff means, but I typed the command "adb logcat" and a lot of text started coming up... But one line that caught my eye right around the time I stepped into a line that caused the "android.jar has no source attachment" error was: "Launch timeout has expired giving wake up lock!"
What do these things mean, and how do I fix them? These errors are coming up with a program that runs perfectly well when not debugging.
Some other possibly relevant information is that I'm using Eclipse and an Android 3.1 tablet.
Upvotes: 0
Views: 254
Reputation: 1559
Logcat is just a place where applications can log messages, just like you printed commands to check the status of your program. This link explains how to log to logcat within an application. What kind of debugging are you looking to do? If you want to see your threads, go to the DDMS perspective in Eclipse, select you device (it has to be plugged in) and process, and click update threads. You will see the running threads in the Threads view.
Also, stepping into lines in your code will try to take you to the android library's code, but you do not have the source attached. Step over the lines instead to keep debugging in your own code, not the Android library.
More info on Android debugging: http://developer.android.com/guide/developing/debugging/index.html
Upvotes: 4