无法在Crashlytics中获取本机崩溃的堆栈跟踪

问题描述:

我有一个包含本机库(.so)的Android项目.我已将Firebase crashlytics集成到我的项目中.我可以在firebase crashlytics中获取Java崩溃的崩溃转储.但是,如果发生本机崩溃-缺少堆栈跟踪例如-它类似于:

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)()

我分别在文件夹app/src/main/obj和app/src/main/libs中添加了本机库的调试和发布版本应用程序build.gradle的相关部分是:

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'
}

我使用命令

./gradlew crashlyticsUploadSymbolsRelease

返回成功的

(我的应用程序的构建版本为Release).我也做了

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.

所以我的问题是:

  1. 我缺少一些步骤吗?

  1. Is there some step which I am missing?

如何调试和修复此问题?

How can I debug and fix this?

不要忘记检查命令 ./gradlew crashlyticsUploadSymbolsRelease --debug 的详细输出.它必须显示成功上传 Crashlytics符号文件之类的消息.如果不是这种情况,请检查可能表明根本原因的周围消息.

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>

请注意,此设置会影响apk大小及其安装大小,如下所述:

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