4

I have an Android project which includes native libraries (.so). I have integrated firebase crashlytics into my project. I am able to get crash dump for the Java crashes in firebase crashlytics. However, in case of native crashes - the stack trace is missing For example - it is something like:

Crashed: Thread: SIGSEGV  0x0000000003000000
       at (Missing)()
       at (Missing)()
       at (Missing)()
       at (Missing)()
       at (Missing)()

I have added the debug and release version of the native libs inside the folder app/src/main/obj and app/src/main/libs respectively The relevant portion of the app build.gradle is:

crashlytics {
    enableNdk true
    androidNdkOut 'src/main/obj/'
    androidNdkLibsOut 'src/main/libs/'
    //manifestPath 'src/main/AndroidManifest.xml'
}

I upload the native symbols using the command

./gradlew crashlyticsUploadSymbolsRelease

which returned success (the build variant of my application is Release). I also did

./gradlew crashlyticsUploadSymbolsDebug

just to be sure, but that also didn't help.

So my questions are:

  1. Is there some step which I am missing?

  2. How can I debug and fix this?

Archit Sinha
  • 775
  • 1
  • 8
  • 33
  • If all the Crashlytics stacktraces are coming back as missing, there is probably something off about the configuration that points Crashlytics to your stripped and unstripped binaries. 1. You could try removing the paths you've set at androidNdkOut and androidNdkLibsOut to let it try to self-resolve 2. You could check the paths there to make sure that the directory structure resembles https://docs.fabric.io/android/crashlytics/ndk.html#specifying-the-path-to-debug-and-release-binaries, where you've got architecture folders with .so's under each folder in the correct structure. – Kevin Kokomani Apr 02 '20 at 18:47
  • @Archit Sinha I'm running into the exact same problem it seems - have you had any luck in resolving this? I have also followed the Firebase documentation thoroughly (https://firebase.google.com/docs/crashlytics/ndk-reports) and am still getting the same output that you have shown ("... at (Missing())"). – Derek Lee Jul 10 '20 at 13:25
  • @DerekLee what I had observed was that it seems to take some time for crashlytics to get the symbols. Don't remember exactly but maybe after 3-4 hours, the stack traces start showing up without any additional changes. The delay was varying each time but was in the order few hours - meaning it started working after that without any other change. Not sure if this is the expected behaviour – Archit Sinha Jul 13 '20 at 14:24

1 Answers1

1

Do not forget to check the verbose output of the command ./gradlew crashlyticsUploadSymbolsRelease --debug. It must show message like Crashlytics symbol file uploaded successfully. If it is not the case, check the surrounding messages that could indicate the root cause.

This was not sufficient in my case, and to fix the issue, I followed an advice found here: I set android:extractNativeLibs to true in the AndroidManifest.xml file.

<application
    android:extractNativeLibs="true"
    ...
</application>

Note that this settings has an impact on the apk size and its installation size as explained here: Setting android:extractNativeLibs=false to reduce app size

shield
  • 139
  • 1
  • 7