Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app doesn't crash, but not responding on uncaught exceptions

I recently noticed, that my app doesn't crash when an uncaught exception occurs, but it is not responding. I use Google Analytics to get insight of crashes, I suspect that this may be the cause of the problem.

When I throw a NullPointerException in onCreate() (immediately after super.onCreate()), the app shows a white screen, but it doesn't crash.

Logcat says:

06-30 14:00:59.386  26259-26259/? I/GAv4﹕ Google Analytics 7.5.71 is starting up. To enable debug logging on a device run:
    adb shell setprop log.tag.GAv4 DEBUG
    adb logcat -s GAv4
06-30 14:00:59.398  26259-26259/? W/GAv4﹕ AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.409  26259-26259/? W/GAv4﹕ CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.414  26259-26295/? W/GAv4﹕ AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.467  26259-26259/? D/AndroidRuntime﹕ Shutting down VM

I would like to see the uncaught exceptions, because it's really hard to fix them if I don't see the stacktrace and the reason of the problem.

What can I do to get back the previous behaviour?

EDIT: After removing Analytics error reporting (not calling tracker.enableExceptionReporting(true);), I get the crashes again. I use Analytics from Play Services 7.5.0.

like image 239
hunyadym Avatar asked Jun 30 '15 12:06

hunyadym


1 Answers

Google Analytics is the culprit. Try disable it (or disable automatic reporting of uncaught exceptions) while you are developing and enable it when you sign your app with the release key.

like image 55
Frederick Nyawaya Avatar answered Oct 01 '22 11:10

Frederick Nyawaya