2

We have an app in production and many of the errors from the crash reports (we use Sentry and BugSnag) are not very meaningful and hard to find/reproduce. How should we deal with them? Most of the time they look like as an internal errors in the iOS/Android (at least from the reports) and don't point to something which we have done wrong in the React Native part. Let's give you an example:

NullPointerExceptioncom.facebook.react.uimanager.NativeViewHierarchyManager in dropView - Attempt to invoke virtual method 'int android.view.View.getId()' on a null object reference. 

The raw output of this error is:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getId()' on a null object reference
    at com.facebook.react.uimanager.NativeViewHierarchyManager.dropView(NativeViewHierarchyManager.java:532)
    at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:424)
    at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:179)
    at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:787)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843)
    at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889)
    at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
    at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129)
    at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
    at android.view.Choreographer.doCallbacks(Choreographer.java:723)
    at android.view.Choreographer.doFrame(Choreographer.java:655)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

This started to become very annoying because of the time spent on them without any useful results.

Chris Geirman
  • 9,474
  • 5
  • 37
  • 70
vaklinzi
  • 1,913
  • 2
  • 18
  • 30
  • It looks like you're attempting to load a record without an identifier/primary key. `console.log()` is a useful tool in debugging situations where you are getting unexpected behavior. Sometimes you just have to log everything in a step-wise manner – fungusanthrax Oct 06 '17 at 13:57

0 Answers0