反应本机堆栈跟踪



React Native App与Firebase Crashlytics有联系。 问题是Firebase发送不可读的堆栈跟踪,例如波纹管。有任何方法可以在错误上读取这种错误。

我只想知道何时抛出错误。

这是我的堆栈跟踪

致命异常:com.facebook.react.common.JavascriptException: 不变违例: 不变违例: 不变违例: 输入范围必须单调不递减 0,-1

此错误位于: 在 n 中 在RCTView 在 T 在 T in 连接(t) 在 T 在RCTView 在RCTView 在RCTView 在 n 中 在 R 中 在 T 在 n 中 在RCTView 在RCTView 在 T 在 T 在RCTView 在 T 在 n 中 在 n 中 在 R 中 在 n 中 在 T 在RCTView in AndroidDrawerLayout in 抽屉布局安卓 在 T 在 n 中 在 n 中 在 E 中 在 T in 连接(t) 在 n 中 in 未知 在RCTView 在RCTView 在 T

此错误位于: 在 n 中 在 T 在RCTView in AndroidDrawerLayout in 抽屉布局安卓 在 T 在 n 中 在 n 中 在 E 中 在 T in 连接(t) 在 n 中 in 未知 在RCTView 在RCTView 在 T

此错误位于: 在 n 中 在 E 中 在 T in 连接(t) 在 n 中 in 未知 在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 your@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文件的形式)。

根据您使用的平台,获取.dSYM会有所不同,但Firebase有一个方便的指南,应该能够在这种特定情况下进一步提供帮助。

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

IOS

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.

人造人

要保留 Crashlytics 需要可读的崩溃报告的信息,请将以下行添加到 Proguard 或 Dexguard 配置文件中:

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

最新更新