无法使用Crashlytics为ReactNative找到有意义的日志 [英] Unable to find meaningful logs for ReactNative using Crashlytics

查看:163
本文介绍了无法使用Crashlytics为ReactNative找到有意义的日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Crashlytic集成到reactNative应用程序中,并试图检查从js文件生成的崩溃日志。它能够捕获它们,但不提供有关文件名的信息。日志从index.android.bundle文件给出位置,很难提供有关崩溃位置的任何信息。
我已经尝试过

I have integrated Crashlytic in reactNative application and tried to check crash logs generated from js files. Its able to capture them but not providing information about the file name. Logs are giving location from index.android.bundle file which are hard to provide any information about crash location. I have already tried

  • react-native-fabric-crashlytics and react-native-fabric npm modules
  • Setting default logger for react native as mentioned in
    https://www.mojotech.com/blog/fabric-integration-for-react-native-on-android/

,但没有用。仍然出现日志,如下所述

but there is no use. Still logs are coming as mentioned below

Fatal Exception: com.facebook.react.common.JavascriptException: ReferenceError: Can't find variable: Button2

This error is located at:
    in t
    in Connect(t)
    in n
    in s
    in RCTView
    in RCTView
    in t, stack:
value@352:2655
u@49:81049
beginWork@49:83749
n@49:112665
i@49:112995
a@49:113436
P@49:118122
k@49:117558
T@49:116698
h@49:115914
d@49:115602
t@49:66915
updateContainer@49:133602
render@49:72179
exports@284:730
run@280:615
runApplication@280:2046
value@27:3582
<unknown>@27:1067
value@27:3009
value@27:1039

       at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:56)
       at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:40)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:164)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
       at java.lang.Thread.run(Thread.java:764)


推荐答案

我认为原因是您使用-dev false 生成了包。尝试使用-dev true 构建软件包。

I think the reason is that you generate your bundle with --dev false. Try to build your bundle with --dev true. It will generate unminified (e.g. normal) Javascript.

react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

这篇关于无法使用Crashlytics为ReactNative找到有意义的日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆