PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.63k stars 9.02k forks source link

NullPointerException: BarLineChartTouchListener.onTouch(Unknown Source) #3880

Open abedsh opened 6 years ago

abedsh commented 6 years ago

I received this error once on an HTC running on Kitkat

    Fatal Exception: java.lang.NullPointerException
            at com.github.mikephil.charting.listener.BarLineChartTouchListener.onTouch(Unknown Source)
            at com.github.mikephil.charting.charts.BarLineChartBase.onTouchEvent(Unknown Source)
       at android.view.View.dispatchTouchEvent(View.java:7813)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1945)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2222)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1965)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2222)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1965)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2222)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1965)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2222)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1965)

Edit: Will provide more info as soon as I get them, all related crashes so far occurred on android oreo so far

almic commented 6 years ago

Very odd. I'll look into this at a future date. In the meantime, could you provide some more information on what exactly you were doing that caused this, and what you were trying to accomplish?

syarihu commented 5 years ago

I also experienced the same problem. The crash log is here.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.VelocityTracker.computeCurrentVelocity(int, float)' on a null object reference
       at com.github.mikephil.charting.listener.BarLineChartTouchListener.onTouch(BarLineChartTouchListener.java:225)
       at com.github.mikephil.charting.charts.BarLineChartBase.onTouchEvent(BarLineChartBase.java:564)
       at android.view.View.dispatchTouchEvent(View.java:12529)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3024)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2705)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:452)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1836)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3400)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410)
       at android.view.View.dispatchPointerEvent(View.java:12768)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5127)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4930)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4447)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4500)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4466)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4606)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4474)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4663)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4447)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4500)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4466)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4474)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4447)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7124)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7093)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7054)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7227)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:187)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:376)
       at android.os.Looper.loop(Looper.java:244)
       at android.app.ActivityThread.main(ActivityThread.java:6710)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
kartikarora commented 4 years ago

Is there any update on this

I just added a bar chart using v3.1.0 and I'm encoutering this issue on every click.