All Articles

Get Crashlytics NDK working

The Crashlytics team happily announced back in 2015 that they finally got support for native crash reporting. Great job guys! Sadly, the official guide hasn’t been updated since then. It’s actually plain missleading now. Luckily I had some forensic Google skillz and half a day dedicated to the task. If you lack any of those, well keep reading ;)

Solution

Well I don’t know why this just isn’t in the official guide, but here it is. It’s simple really. You should probably check so that dependency is up to date if you bother.

  1. Add (the secret) crashlytics ndk dependency

    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.6@aar') {
      transitive = true
    }
    
  2. Add this closure to your build.gradle as well (the guide mentions deprecated “baseManifestPath”, ignore that)

    crashlytics {
      enableNdk true
      androidNdkOut 'obj'
      androidNdkLibsOut 'libs'
    }
    

That’s the dependency that isn’t mentioned in the guide right there, took me forever to find it, no joke.

Aftermath

I’ve verified that it works by creating a debug-crash thingy in our JNI library for testing. Crashlytics is able to proberly show a sane stack trace (even better than in Android Studio!)

You can continue to read how to get Crashlytics working with Cmake, takes some extra work.

Code hard.

Published 2 Jun 2017