How to report third party NDK crashes using crashlytics

痞子三分冷 提交于 2019-12-07 09:31:37

问题


I am getting the following NDK crash report from Google Play Console, but not in Crashlytics.

#00  pc 0000000000049c44  /system/lib/libc.so (tgkill+12)
#01  pc 00000000000473e3  /system/lib/libc.so (pthread_kill+34)
#02  pc 000000000001d535  /system/lib/libc.so (raise+10)
#03  pc 0000000000019081  /system/lib/libc.so (__libc_android_abort+34)
#04  pc 00000000000170e4  /system/lib/libc.so (abort+4)
#05  pc 000000000000c3a1  /system/lib/libcutils.so (__android_log_assert+112)
#06  pc 000000000002352d  /system/lib/libhwui.so
#07  pc 0000000000024db3  /system/lib/libhwui.so
#08  pc 00000000000281a9  /system/lib/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+80)
#09  pc 000000000000e361  /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+140)
#10  pc 0000000000064d19  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+80)
#11  pc 0000000000046eb3  /system/lib/libc.so (_ZL15__pthread_startPv+22)
#12  pc 0000000000019acd  /system/lib/libc.so (__start_thread+6)

I would like to have Crashltytics to also report these crashes. We don't use any NDK library and the crash should be coming from external 3rd party libraries. I am reading https://docs.fabric.io/android/crashlytics/ndk.html, yet still not sure how to do it.

Question 1

Given that I am already using Crashlytics in my Android app, what is the exact configuration change I have to make/add to have crashlytics report NDK crashes from external 3rd party library?

Question 2

In https://docs.fabric.io/android/crashlytics/ndk.html, it mentioned Uploading symbols for external dependencies. What are symbols? Should I care about it?

Thanks in advance.


回答1:


You can include craslytics ndk to your build.gradle, and the native crashes will be reported in the same dashboard. Recently, crashlytics got integrated with Firebase.

crashlytics {
  enableNdk true
}
implementation 'com.crashlytics.sdk.android:crashlytics:2.8.0'
implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.0.1'

And in Java you must add NDK:

Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());

nativeInitCrashlytics();

Uploading symbols, these reports may get more meaningful, but this is not relevant for you, because you don't have sources for the third party native libs, and it does not really help to know the name of the function where it crashes.

This said, please note that it's quite possible that this specific crash will still not appear in Crashlytics dashboard. The stack suggests that some hardware accelerated rendering procedure failed. There may be no direct relation to your code.



来源:https://stackoverflow.com/questions/48451956/how-to-report-third-party-ndk-crashes-using-crashlytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!