Unable to find meaningful logs for ReactNative using Crashlytics
Asked Answered
M

2

4

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

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)
Marilumarilyn answered 23/5, 2018 at 4:56 Comment(0)
H
1

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/
Hinojosa answered 6/12, 2018 at 10:6 Comment(0)
L
0

I know without source maps, it is very difficult to understand the logs. I've made some changes in the react-native default error handler and throwing some native exceptions too. Here is my article on it. Let me know if this helps.

Using Crashlytics with React Native Android App

Lankford answered 31/5, 2018 at 20:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.