Often my programs simply crash. I can't see anything in the LogCat or otherwise useful information elsewhere to find out what's gone wrong. The only thing I see is some kind of exception. This is unacceptable and makes Android programming nearly impossible. I'm sure there must be some additional help to debugging, but after weeks of searching, nothing.
Does anyone have hints on how to find a bug in a program that simply crashes?
General question I know, but without an answer, I'm going to have to quit trying to develop apps for Android. I can't spend weeks of searching for every simple mistake.
There's also the actual Eclipse debugger. If you just run the program with the debugger until it crashes, you may not see a particularly helpful stack trace. But if you add a breakpoint or two in the code that comes just before the crash, you can step through carefully and figure out what's going wrong.
Also, although I'm still pretty new to Android development, my experience is that most of the mysterious crashes in my code are essentially ClassCastException
s. Look carefully for all the places where you're casting something from one class to another, and make sure you're not assuming something is of a type that it's actually not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With