Android: Message capture working, crash exception capture not working

With a previous app, I was able to get Android app crash capturing working without a problem. It’s still working in the field, capturing a few hundred events a day (it was a horrible app).

With my new app, I absolutely cannot get crash reporting to work. I can use Sentry.capture to get individual messages without an issue, so I know that I haven’t mistyped my DSN or anything. I can see the exception get caught by the sentry handler, I can see the exceptions piling up in the disk cache, but it simply will not push them out. I’ve gone so far as to write my own UncaughtExceptionHandler where I explicitly capture the exception using an EventBuilder (and I KNOW I get to this code), but nothing works, regardless of Android version, build variant, etc.

Any ideas? Is there any sort of debugging or verbose logging I can turn on to try and figure out why this is happening?

Figured it out. And don’t want to be that guy that leaves ya hanging…

First all, to enable logging as part of the Android logcat, you need to include the slf4j-android projected INSTEAD of the slf4j-nop (which is /dev/null logging) in your build.gradle. For production, you’ll probably want to switch back to slf4j-nop since you normally don’t want that level of logging.

From there, it was just a few minutes before I was able to find that sentry was blowing up on the HTTPS connection. I was using a self-signed cert for my API calls but was doing it slightly wrong (setDefaultSSLSocketFactory is a no-no), causing HTTPS to break downstream and causing sentry to fail.

Fixed, and happily (?) receiving crashes once again.

1 Like