error on modifying the sample android app of Metawear

I downloaded the sample code for metawear app in my system, which was running fine,
but on changing a little bit in UI part its giving an error "ArrayIndexOutOfBoundException" while plotting graph in the app.
Please hel

Comments

  • What exactly did you change?
  • Thanks for the fast reply,
    I just added an extra item in the navigation list(it don't have any listeners on it), then if I start accelerometer  or gyro, app crashes after plotting graph for 2-3 sec, with following exception.

    I reverted all the changes back to original code, now the app is working fine for first 3-4 time. after that it crashes with the same exception on running accelorometer or gyro:

    05-24 11:41:32.576 18567-18567/com.mbientlab.metawear.app D/AndroidRuntime: Shutting down VM
    05-24 11:41:32.579 18567-18567/com.mbientlab.metawear.app E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: com.mbientlab.metawear.app, PID: 18567
                                                                                java.lang.ArrayIndexOutOfBoundsException: length=572; index=572
                                                                                    at com.github.mikephil.charting.buffer.LineBuffer.lineTo(LineBuffer.java:36)
                                                                                    at com.github.mikephil.charting.buffer.LineBuffer.feed(LineBuffer.java:53)
                                                                                    at com.github.mikephil.charting.renderer.LineChartRenderer.drawLinear(LineChartRenderer.java:299)
                                                                                    at com.github.mikephil.charting.renderer.LineChartRenderer.drawDataSet(LineChartRenderer.java:121)
                                                                                    at com.github.mikephil.charting.renderer.LineChartRenderer.drawData(LineChartRenderer.java:98)
                                                                                    at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:230)
  • FYI I am using MetawearRG
  • edited May 2017
    Can you post more lines of stack trace?  What you have posted only tells me where in the charting library the crash occurs, not where in the app.
  • Couldn't copy the error log here. Character limits are exceeding

    this is my Dropbox link where the error message is uploaded.

    But this error is sporadic, Sometimes the app runs flawlessly, but many a times it crashes.
     
  • The error is most likely caused by the automatic graph scrolling.  You can try fiddling with the offsets to see what stabilizes the app for your device.

This discussion has been closed.