react-native-fabric icon indicating copy to clipboard operation
react-native-fabric copied to clipboard

Crashlytics.log don't logs into console on android, but on iOS

Open ColCh opened this issue 8 years ago • 7 comments

it logs on iOS into console, but on android - not

from Crashlyrics support: http://support.crashlytics.com/knowledgebase/articles/120066-how-do-i-use-logging

If you don't want to write to LogCat you should call Crashlytics.log(msg)

simply saying, it would be cool to log into console with Crashlytics.log

may be use LOG.Info by default? (https://developer.android.com/reference/android/util/Log.html#INFO)

ColCh avatar Dec 14 '16 18:12 ColCh

Am getting something similar issue, that; the Crashlytics.logException('Test message'); for Android DOES NOT send a string message (as it is) to Fabric. Instead it sends a too-long error in json format, which i don't need. I just need to send a simple string message. However the Crashlytics.recordError('Test message'); for iOS DOES send a string message (as it is) to Fabric.

Snap of Android error

  • image

Snap of iOS error

  • image

@corymsmith It would be good, if there is any way to just send a simple string error to Fabric, from Android.

s2zaman avatar Feb 24 '17 13:02 s2zaman

@s2zaman Please take a look on this wrapper https://gist.github.com/ColCh/d1daf4864a931faeb3d5c3d07917ebef Example on throw new Error(...):

IOS image

android image

ColCh avatar Feb 24 '17 13:02 ColCh

@s2zaman and a note how to translate error stacks to readable thing using source map: https://github.com/corymsmith/react-native-fabric/issues/2#issuecomment-279140824

ColCh avatar Feb 24 '17 13:02 ColCh

@ColCh yupp and Thanks for those points 👍 But i need to send a plain string message Only. Still i will try to look for that.

s2zaman avatar Feb 24 '17 13:02 s2zaman

Been using react-native-fabric for a while and happy with it, thanks for your efforts guys. Today I've been facing a difficult one. My app crashes on launch, but only on a real device using a Release build. (Debug on Simulator works fine.)

image

@ColCh You've done some interesting work on this. I tried using require('./js/log.js') in my index.ios.js as suggested but still getting the minified stacktrace. Did I miss something?

============ RN 0.37 macOS 10.12.3 node 7.7.1

onpaws avatar Mar 11 '17 01:03 onpaws

It's reporting minified stacktrace - it's okay, at least to me... I didn't managed to include sourcemap into app, because it will share source codes then. And, to convert stacktrace to normal view on Crashlytics, stack-beautifier needs sourcemap file, and on RN there is no such possibility by-default.

ColCh avatar Mar 11 '17 07:03 ColCh

I have the same problem

# Platform: android
# Version: N/A
# Issue #: 39
# Issue ID: 5901c7c6be077a4dccfb5605
# Session ID: 5902115C013B00012987A291C8E7FD51_45220680a6a14904b72129a9d75350d9_2_v1
# Date: 2017-04-27T16:08:33Z
# OS Version: 6.0
# Device: Infinix HOT 4
# RAM Free: 33.3%
# Disk Free: 74.4%

#0. Crashed: mqt_native_modules: 0 0 0x0000000000000000
       at com.smixx.fabric.SMXCrashlytics.logException(SMXCrashlytics.java:33)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:207)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
       at java.lang.Thread.run(Thread.java:818)

--

Non-fatal Exception: java.lang.RuntimeException: error: {"framesToPop":1,"code":"ENOENT"}
       at com.smixx.fabric.SMXCrashlytics.logException(SMXCrashlytics.java:33)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:207)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
       at java.lang.Thread.run(Thread.java:818)

#0. Crashed: mqt_native_modules: 0 0 0x0000000000000000
       at com.smixx.fabric.SMXCrashlytics.logException(SMXCrashlytics.java:33)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:207)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
       at java.lang.Thread.run(Thread.java:818)

chitezh avatar Apr 28 '17 07:04 chitezh