I get ANR on both occasions:
throw new NullPointerException("random null pointer");
and
while(true){}
Only in exception part VM actually shuts down (D/AndroidRuntime﹕ Shutting down VM).
Second question is: How to force app to crash instead of ANR and get stack trace in logcat?
Update Changed Title From what is difference between ANR and Crash.
Update It occurred only about 3-4 months ago. Since then, only way to find what's crashing is to put try catch boxes everywhere with no reason at all.
I am facing the same problem and when I am debugging I reach the code "throw RuntimeException" but I am also having an ANR instead.
The only clue that I have is that it started to happen when I configured Google Analytics in my app. Is this your case, @Alpha ?
I haven't gone beyond because I am kind of dealing with it like this, but some day I will debug specially for this issue with analytics.
EDIT: The issue is solved in Google Play Services 8.4. We can finally report uncaught exceptions! The app seems to be blocked for some seconds but finally exception is thrown and reported without ANR.
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