java.lang.NullPointerException: Attempt to invoke interface method 'int com.demo.mpchart.IBarDataSet.getBarBorderColor()' on a null object reference

GitHub | kavitamp | 4 months 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

    NullPointerException at getBarBorderColor()

    GitHub | 4 months ago | kavitamp
    java.lang.NullPointerException: Attempt to invoke interface method 'int com.demo.mpchart.IBarDataSet.getBarBorderColor()' on a null object reference
  2. 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)
  3. 0
    samebug tip
    When you use findViewById inside an activity it is going to look for a View inside your main_activity.xml. If it's not there, it throws this exception, try to use the right view to call findviewById.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NullPointException

    GitHub | 3 months ago | MoonlightSW
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.github.mikephil.charting.buffer.BarBuffer.setPhases(float, float)' on a null object reference
  6. 0
    samebug tip
    This issue was solved in 2.2.6. If updating doesn't solve, try using notifyItemRangeChanged(1, mDatas.size()) instead of notifyItemRangeChanged(0, mDatas.size()).

    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.NullPointerException

      Attempt to invoke interface method 'int com.demo.mpchart.IBarDataSet.getBarBorderColor()' on a null object reference

      at com.demo.mpchart.BarChartRenderer.drawDataSet()
    2. com.demo.mpchart
      BarChartRenderer.drawData
      1. com.demo.mpchart.BarChartRenderer.drawDataSet(BarChartRenderer.java:114)
      2. com.demo.mpchart.BarChartRenderer.drawData(BarChartRenderer.java:77)
      2 frames
    3. com.smartbro.mpchart
      BarLineChartBase.onDraw
      1. com.smartbro.mpchart.BarLineChartBase.onDraw(BarLineChartBase.java:217)
      1 frame
    4. Android Platform
      View.draw
      1. android.view.View.draw(View.java:17134)
      2. android.view.View.updateDisplayListIfDirty(View.java:16116)
      3. android.view.View.draw(View.java:16900)
      4. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      5. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      6. android.view.View.updateDisplayListIfDirty(View.java:16111)
      7. android.view.View.draw(View.java:16900)
      8. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      9. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      10. android.view.View.draw(View.java:17137)
      11. android.view.View.updateDisplayListIfDirty(View.java:16116)
      12. android.view.View.draw(View.java:16900)
      13. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      14. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      15. android.view.View.draw(View.java:17137)
      16. android.view.View.updateDisplayListIfDirty(View.java:16116)
      17. android.view.View.draw(View.java:16900)
      18. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      19. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      20. android.view.View.updateDisplayListIfDirty(View.java:16111)
      21. android.view.View.draw(View.java:16900)
      22. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      23. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      24. android.view.View.draw(View.java:17137)
      25. android.widget.ScrollView.draw(ScrollView.java:1735)
      26. android.view.View.updateDisplayListIfDirty(View.java:16116)
      27. android.view.View.draw(View.java:16900)
      28. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      29. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      30. android.view.View.draw(View.java:17137)
      30 frames
    5. Android Support v4
      ViewPager.draw
      1. android.support.v4.view.ViewPager.draw(ViewPager.java:2259)
      1 frame
    6. Android Platform
      ViewGroup.drawChild
      1. android.view.View.updateDisplayListIfDirty(View.java:16116)
      2. android.view.View.draw(View.java:16900)
      3. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      4. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      5. android.view.View.draw(View.java:17137)
      6. android.view.View.updateDisplayListIfDirty(View.java:16116)
      7. android.view.View.draw(View.java:16900)
      8. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      8 frames
    7. Android Support v4
      DrawerLayout.drawChild
      1. android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1229)
      1 frame
    8. Android Platform
      View.draw
      1. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      2. android.view.View.updateDisplayListIfDirty(View.java:16111)
      3. android.view.View.draw(View.java:16900)
      4. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      5. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      6. android.view.View.updateDisplayListIfDirty(View.java:16111)
      7. android.view.View.draw(View.java:16900)
      8. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      9. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      10. android.view.View.updateDisplayListIfDirty(View.java:16111)
      11. android.view.View.draw(View.java:16900)
      12. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      13. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      14. android.view.View.updateDisplayListIfDirty(View.java:16111)
      15. android.view.View.draw(View.java:16900)
      16. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      17. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      18. android.view.View.updateDisplayListIfDirty(View.java:16111)
      19. android.view.View.draw(View.java:16900)
      20. android.view.ViewGroup.drawChild(ViewGroup.java:3764)
      21. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
      22. android.view.View.draw(View.java:17137)
      22 frames
    9. Android
      DecorView.draw
      1. com.android.internal.policy.DecorView.draw(DecorView.java:751)
      1 frame
    10. Android Platform
      ActivityThread.main
      1. android.view.View.updateDisplayListIfDirty(View.java:16116)
      2. android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:656)
      3. android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:662)
      4. android.view.ThreadedRenderer.draw(ThreadedRenderer.java:770)
      5. android.view.ViewRootImpl.draw(ViewRootImpl.java:2830)
      6. android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2638)
      7. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2245)
      8. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1272)
      9. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6396)
      10. android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
      11. android.view.Choreographer.doCallbacks(Choreographer.java:683)
      12. android.view.Choreographer.doFrame(Choreographer.java:619)
      13. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
      14. android.os.Handler.handleCallback(Handler.java:751)
      15. android.os.Handler.dispatchMessage(Handler.java:95)
      16. android.os.Looper.loop(Looper.java:154)
      17. android.app.ActivityThread.main(ActivityThread.java:6209)
      17 frames
    11. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Method.java)
      1 frame
    12. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
      2 frames