Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

NullPointerException report #41

Open
aveuiller opened this issue Feb 12, 2018 · 6 comments
Open

NullPointerException report #41

aveuiller opened this issue Feb 12, 2018 · 6 comments

Comments

@aveuiller
Copy link

A bug has been reported on production:

  • App version: 6 (2.0.0)
  • Api level: 24
  • phone model: P028
  • Time: 9 févr. 2018 à 15:45:20
 Exception java.lang.NullPointerException: Attempt to invoke interface method 'int com.github.mikephil.charting.interfaces.datasets.IDataSet.getEntryIndex(com.github.mikephil.charting.data.Entry)' on a null object reference
com.github.mikephil.charting.charts.Chart.drawMarkers (Chart.java:732)
com.github.mikephil.charting.charts.BarLineChartBase.onDraw (BarLineChartBase.java:271)
android.view.View.draw (View.java:17320)
android.view.View.updateDisplayListIfDirty (View.java:16259)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:3874)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:3854)
android.view.View.updateDisplayListIfDirty (View.java:16213)
android.view.View.draw (View.java:17070)
android.view.ViewGroup.drawChild (ViewGroup.java:3890)
android.view.ViewGroup.dispatchDraw (ViewGroup.java:3676)
com.android.internal.policy.DecorView.dispatchDraw (DecorView.java:792)
android.view.View.draw (View.java:17332)
com.android.internal.policy.DecorView.draw (DecorView.java:778)
android.view.View.updateDisplayListIfDirty (View.java:16259)
android.view.ThreadedRenderer.updateViewTreeDisplayList (ThreadedRenderer.java:661)
android.view.ThreadedRenderer.updateRootDisplayList (ThreadedRenderer.java:667)
android.view.ThreadedRenderer.draw (ThreadedRenderer.java:775)
android.view.ViewRootImpl.draw (ViewRootImpl.java:3196)
android.view.ViewRootImpl.performDraw (ViewRootImpl.java:2989)
android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2569)
android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1462)
android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:6973)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:907)
android.view.Choreographer.doCallbacks (Choreographer.java:709)
android.view.Choreographer.doFrame (Choreographer.java:644)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:893)
android.os.Handler.handleCallback (Handler.java:836)
android.os.Handler.dispatchMessage (Handler.java:103)
android.os.Looper.loop (Looper.java:208)
android.app.ActivityThread.main (ActivityThread.java:6304)

@kaal-dam
Copy link
Contributor

whaou, interesting, seems to be an internal api error since i don't see any error line from one of our class.

can we have more information about this issue like what are you trying to do when it appears ?

@aveuiller
Copy link
Author

Hello,

Sorry but I can't tell you more since I'm only managing the application production. This error has been reported on our Firebase dashboard.

@aoudiamoncef
Copy link
Contributor

aoudiamoncef commented Feb 12, 2018

Hello,
This is known issue in MPAndroidChart:
PhilJay/MPAndroidChart#2917

@aoudiamoncef
Copy link
Contributor

aoudiamoncef commented Feb 16, 2018

This issue happens to me when I remove the line where the marker is on at the moment.
I managed to get around this bug by .setDrawMarkers(false); on chart creation and only doing .setDrawMarkers(true); inside onValueSelected()
fixed on f5f5f19

@SwordBearer
Copy link

When I show a MarkerView first , and then I show the a empty ArrayList , This crash happened.
So before i show the data, if the dataset is empty, just call
mpChart.setDrawMarkers(false); to disable the marker-view

image

@rouvoy
Copy link
Contributor

rouvoy commented Jul 2, 2018

Can you provide some more information or ideally submit a pull request?

@rouvoy rouvoy reopened this Jul 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants