java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.
java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
at java.util.ArrayList.get(ArrayList.java:310)
at com.example.alaashammaa.charts.MainActivity$1.getFormattedValue(MainActivity.java:65)
at com.github.mikephil.charting.components.AxisBase.getFormattedLabel(AxisBase.java:451)
at com.github.mikephil.charting.components.AxisBase.getLongestLabel(AxisBase.java:437)
at com.github.mikephil.charting.renderer.XAxisRenderer.computeSize(XAxisRenderer.java:78)
at com.github.mikephil.charting.renderer.XAxisRenderer.computeAxisValues(XAxisRenderer.java:73)
at com.github.mikephil.charting.renderer.XAxisRenderer.computeAxis(XAxisRenderer.java:66)
at com.github.mikephil.charting.charts.BarLineChartBase.notifyDataSetChanged(BarLineChartBase.java:339)
at com.github.mikephil.charting.charts.Chart.onSizeChanged(Chart.java:1727)
at com.github.mikephil.charting.charts.BarLineChartBase.onSizeChanged(BarLineChartBase.java:1563)
at android.view.View.sizeChange(View.java:18114)
at android.view.View.setFrame(View.java:18076)
at android.view.View.layout(View.java:17991)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17995)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2759)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2460)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1528)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7564)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Users with the same issue

3 times, 4 months ago
6 times, 8 months ago
2 times, 9 months ago
2 times, 11 months ago
40 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.