简体   繁体   English

如何在Crashlytics中获取golang的堆栈跟踪

[英]How to get the Stack-trace of golang in the Crashlytics

Our's app is a Android app, which has a JNI writed by golang. 我们的应用程序是一个Android应用程序,它具有由golang编写的JNI。 And we use the Fabric Crashlytics to track carshes. 而且,我们使用Fabric Crashlytics来跟踪糖浆。

But, we can not get the Stack-trace information in the Crashlytics, after a crash happened in the JNI. 但是,在JNI中发生崩溃之后,我们无法在Crashlytics中获取堆栈跟踪信息。 In the Java, We can get it. 在Java中,我们可以得到它。

In the Object-C for iOS app, we can upload the dSYM file to map the functions. 在iOS的Object-C应用程序中,我们可以上传dSYM文件以映射功能。 But where can I do it with Golang? 但是我在哪里可以用Golang做到呢?

Does the Fabric support it? 面料支持吗?

Now, in the Crashlytics, we can see below only: 现在,在Crashlytics中,我们只能看到以下内容:

Crashed: Thread
0  libc.so                        0xf6f4c778 (Missing)
1  libc.so                        0xf6f26791 (Missing)
2  libc.so                        0xf6f23933 (Missing)
3  (Missing)                      0x15c791e6 (Missing)
4  libgojni.so                    0xdddd910e (Missing)
5  libc.so                        0xf6f214ee (Missing)
6  (Missing)                      0x15c791e6 (Missing)
7  libgojni.so                    0xde00a8de (Missing)
8  libgojni.so                    0xde00a93e (Missing)
9  libgojni.so                    0xdddd8ed6 (Missing)

We have been resolved this issue. 我们已经解决了这个问题。

The background: 的背景:

We build a Android app, it has a JNI writed by go, which is build by gomobile. 我们构建了一个Android应用,它具有由gomobile编写的JNI,该应用由gomobile构建。 We use the Fabric Crashlytics to monitor the crash information. 我们使用Fabric Crashlytics监视崩溃信息。 But in the Crashlytics, we could not see the full stack trace information which occurred in the JNI. 但是在Crashlytics中,我们看不到JNI中发生的完整堆栈跟踪信息。

The Solution is: 解决方案是:

At the first, please check your NDK version, it must be r17c or more. 首先,请检查您的NDK版本,它必须是r17c或更高。

Add a param --work in the gomobile command, like gomobile bind --work YOUR-SOURCE-CODE-PATH WORK=TEMP-PATH . 在gomobile命令中添加参数--work ,例如gomobile bind --work YOUR-SOURCE-CODE-PATH WORK=TEMP-PATH

After build successful, move the all of files in the jniLibs to YOUR-PROJECT-PATH/app/obj . 构建成功后,将jniLibs的所有文件移动到YOUR-PROJECT-PATH/app/obj

At the last, do the steps list in Fabric docs. 最后,执行Fabric文档中的步骤列表。

Hope our experiences can save your time :-) 希望我们的经验可以节省您的时间:-)

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

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