Reputation: 3357
I'm using Eclipse.
I'm burning hours trying to debug my first (very simple) android app.
When I hit an error, I don't get a proper exception with a description of what went wrong, I get a screen asking for source code and a "Suspended(Exception RuntimeException))" on the debug log.
I'm resorting to logging each line to see where the last execution point was, and then trying to understand by googling why the following line would cause an error.
See my screenshots: Error and Missing Source.
The highlighted line:
SimpleCursorAdapter scaSights = new SimpleCursorAdapter(this,R.layout.sight_row,sightsCursor,fromDisplayFields,toDataFields);
is where the exception occurs. I've got no idea what's wrong there, but a good exception message would help, not a prompt for source code.
Any help is hugely appreciated!
Upvotes: 0
Views: 193
Reputation: 22637
It's happening because you have an exception on a line you are tracing over, and you are now tracing into the SDK classes where the exception is being thrown from. This is normal and expected, although not terribly useful. When this happens, there's not much you can do beyond just "play" the debugger and look at the logcat log to see the exception stack trace.
If you want to see the exception in the debugger, you can put a try { ... } catch (Throwable t) around the block, then set a breakpoint in the catch and inspect the exception, and the state of your other objects.
Upvotes: 2
Reputation: 3106
Hmm. From what I can see in your wtf.jpg pic, that line 86 does not appear to be part of the stack trace, so I don't know if it is causing the problem.
Some notes to help with debugging:
Upvotes: 1
Reputation:
logcat normally prints any uncaught exceptions. An alternative to reviewing the logs is to surround that code with try-catch, and then print the error message and/or stack trace.
Upvotes: 1