androideclipseandroid-activityandroid-debugging

Good strategy to debug this?


Android (4.2.2) application developed in Java on Eclipse, I'm getting a crash but I can't figure out what in my code is causing it . . .

The stack trace doesn't reference any of my own source code . . .

Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2255
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2309 ActivityThread.access$700(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 157
ActivityThread$H.handleMessage(Message) line: 1289
ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 176 ActivityThread.main(String[]) line: 5317
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 511 ZygoteInit$MethodAndArgsCaller.run() line: 1102 ZygoteInit.main(String[]) line: 869 NativeStart.main(String[]) line: not available [native method]

... I launch several activities in my app and all of them are wrapped in a try/catch but if I set breakpoints in the catch blocks they aren't being hit, and if I step over the code that launches the Activities nothing seems amiss. Nor is the system writing anything to Logcat indicating any exceptions (no filters on Logcat, full Verbose output).

Clicking on the above lines just gives me "source not found". Is there a way to see what Activity it's trying to start or what the nature of the exception is?


Solution

  • After researching this I saw the answer to this question here:

    How do I prevent exception catching in Android?

    Which suggest to keep executing the code until you get info in your logcat that pertains to your code.

    Just a note on using verbose, etc.
    Also, I personally just focus on errors when I begin debugging. I find it's easier to read. I remove all the errors from the logcat before I start looking at warnings. Also with verbose, if the program is really not running well, the logcat can have trouble keeping up.

    This is my own personal style of debugging, it's by no means law.

    Good luck with this.