本文介绍了反应本机堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 React Native App 与Firebase Crashlytics链接了.问题是firebase发送像下面这样的不可读堆栈跟踪.可以通过任何方式阅读此类错误信息.

I have React Native App linked with Firebase Crashlytics.The issue is firebase sending unreadable stack trace like the one bellow. There is any way to read this kind on errors.

我只想知道何时引发错误.

I just want to know when the error is thrown.

这是我的堆栈跟踪

此错误位于:客栈在RCTView中在t在t在Connect(t)中在t在RCTView中在RCTView中在RCTView中客栈在r在t客栈在RCTView中在RCTView中在t在t在RCTView中在t客栈客栈在r客栈在t在RCTView中在AndroidDrawerLayout中在DrawerLayoutAndroid中在t客栈客栈在e中在t在Connect(t)中客栈在未知在RCTView中在RCTView中在t

This error is located at: in n in RCTView in t in t in Connect(t) in t in RCTView in RCTView in RCTView in n in r in t in n in RCTView in RCTView in t in t in RCTView in t in n in n in r in n in t in RCTView in AndroidDrawerLayout in DrawerLayoutAndroid in t in n in n in e in t in Connect(t) in n in Unknown in RCTView in RCTView in t

此错误位于:客栈在t在RCTView中在AndroidDrawerLayout中在DrawerLayoutAndroid中在t客栈客栈在e中在t在Connect(t)中客栈在未知在RCTView中在RCTView中在t

This error is located at: in n in t in RCTView in AndroidDrawerLayout in DrawerLayoutAndroid in t in n in n in e in t in Connect(t) in n in Unknown in RCTView in RCTView in t

此错误位于:客栈在e中在t在Connect(t)中客栈在未知在RCTView中在RCTView中在t中,堆栈:v @ 178:1977 p @ 178:269 e @ 178:2406 value @ 188:720_renderIndicator @ 718:1582 value @ 718:5454 qn @ 106:40634 tr @ 106:46334 Nr @ 106:56528 Ur @ 106:56960 ui @ 106:61804 oi @ 106:61224 Ue @ 106:68050IE @ 106:14248我们@ 106:14421 receiveTouches @ 106:15235值@ 18:3352@ 18:935值@ 18:2621值@ 18:907

This error is located at: in n in e in t in Connect(t) in n in Unknown in RCTView in RCTView in t, stack: v@178:1977 p@178:269 e@178:2406 value@188:720 _renderIndicator@718:1582 value@718:5454 qn@106:40634 tr@106:46334 Nr@106:56528 Ur@106:56960 ui@106:61804 oi@106:61224 Ue@106:68050 Ie@106:14248 We@106:14421 receiveTouches@106:15235 value@18:3352 @18:935 value@18:2621 value@18:907

   at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
   at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
   at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
   at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
   at android.os.Handler.handleCallback(Handler.java:808)
   at android.os.Handler.dispatchMessage(Handler.java:101)
   at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
   at android.os.Looper.loop(Looper.java:166)
   at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
   at java.lang.Thread.run(Thread.java:784)

推荐答案

这称为混淆,您有意义的符号被无意义的符号代替,以减少生产中的文件大小.通常,在构建应用程序时,它会生成反混淆文件(通常以 .dSYM 文件的形式),可用于符号化您的应用程序.

This is called obfuscation, your meaningful symbols are replaced with meaningless ones to reduce file size in production. Generally when you build your app, it produces deobfuscation files (normally in the form of a .dSYM file) that can be used to symbolicate your app.

根据使用的平台,获取.dSYM有所不同,但是 firebase有一个方便的指南,应该可以针对这种特定情况提供进一步的帮助.

Getting your .dSYM is different based on the platform you're using, but firebase has a handy guide that should be able to further help in this specific case.

出于文档目的,我将对该答案中提供的步骤进行硬编码.

For the purposes of documentation, I'll hardcode the steps provided there in this answer.

Open your project in Xcode, and select the project file in the Xcode Navigator.

Select your main build target from the Select a project or target dropdown.

Open the target's Build Settings tab.

Click All near the top of the tab.

Search for "debug information format".

Set Debug Information Format to DWARF with dSYM File.

Android

-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception

这篇关于反应本机堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 19:56