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

GitHub | HannahMitt | 5 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    Android has some problem with big images, so, probably, the image you're trying to use is too big for Canvas. You can either use Picasso or compress your image to reduce it's size (both pixel wise and filesize wise)
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      length=0; index=-1

      at com.jjoe64.graphview.GraphView.getMaxX()
    2. com.jjoe64.graphview
      GraphView$GraphViewContentView.onDraw
      1. com.jjoe64.graphview.GraphView.getMaxX(GraphView.java:469)
      2. com.jjoe64.graphview.GraphView$GraphViewContentView.onDraw(GraphView.java:67)
      2 frames
    3. Android Platform
      FrameLayout.draw
      1. android.view.View.draw(View.java:13458)
      2. android.view.View.draw(View.java:13342)
      3. android.view.ViewGroup.drawChild(ViewGroup.java:2929)
      4. android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
      5. android.view.View.draw(View.java:13340)
      6. android.view.ViewGroup.drawChild(ViewGroup.java:2929)
      7. android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
      8. android.view.View.draw(View.java:13340)
      9. android.view.ViewGroup.drawChild(ViewGroup.java:2929)
      10. android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
      11. android.view.View.draw(View.java:13340)
      12. android.view.ViewGroup.drawChild(ViewGroup.java:2929)
      13. android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
      14. android.view.View.draw(View.java:13340)
      15. android.view.ViewGroup.drawChild(ViewGroup.java:2929)
      16. android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
      17. android.view.View.draw(View.java:13461)
      18. android.widget.FrameLayout.draw(FrameLayout.java:467)
      18 frames
    4. Android
      PhoneWindow$DecorView.draw
      1. com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2183)
      1 frame
    5. Android Platform
      ActivityThread.main
      1. android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2256)
      2. android.view.ViewRootImpl.draw(ViewRootImpl.java:2151)
      3. android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2019)
      4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1830)
      5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
      6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
      7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
      8. android.view.Choreographer.doCallbacks(Choreographer.java:555)
      9. android.view.Choreographer.doFrame(Choreographer.java:525)
      10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
      11. android.os.Handler.handleCallback(Handler.java:615)
      12. android.os.Handler.dispatchMessage(Handler.java:92)
      13. android.os.Looper.loop(Looper.java:137)
      14. android.app.ActivityThread.main(ActivityThread.java:4745)
      14 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:511)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      2 frames
    8. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame