简体   繁体   English

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

[英]Unable to get stack trace for native crashes in Crashlytics

I have an Android project which includes native libraries (.so).我有一个包含本机库 (.so) 的 Android 项目。 I have integrated firebase crashlytics into my project.我已将 firebase crashlytics 集成到我的项目中。 I am able to get crash dump for the Java crashes in firebase crashlytics.我能够在 firebase crashlytics 中获取 Java 崩溃的崩溃转储。 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:我在文件夹 app/src/main/obj 和 app/src/main/libs 中分别添加了本地库的调试和发布版本 app build.gradle 的相关部分是:

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?我该如何调试和解决这个问题?

Do not forget to check the verbose output of the command ./gradlew crashlyticsUploadSymbolsRelease --debug .不要忘记检查命令./gradlew crashlyticsUploadSymbolsRelease --debug的详细输出。 It must show message like Crashlytics symbol file uploaded successfully .它必须显示类似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.这对我来说还不够,为了解决这个问题,我遵循了这里的建议:我在AndroidManifest.xml文件中将android:extractNativeLibs设置为true

<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请注意,此设置对 apk 大小及其安装大小有影响,如下所述: 设置 android:extractNativeLibs=false 以减少应用程序大小

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM