halfhp / androidplot

Charts and plots for Android
http://androidplot.com
Apache License 2.0
505 stars 159 forks source link

IllegalArgumentException caused from com.androidplot.Plot$BufferedCanvas.resize (Plot.java:234) in Android 5.1 #94

Closed pwireless closed 5 years ago

pwireless commented 5 years ago

Hello, noticed the following crash in the 1.5.6 release:

java.lang.IllegalArgumentException: at android.graphics.Bitmap.nativeCreate (Bitmap.java) at android.graphics.Bitmap.createBitmap (Bitmap.java:824) at android.graphics.Bitmap.createBitmap (Bitmap.java:801) at android.graphics.Bitmap.createBitmap (Bitmap.java:768) at com.androidplot.Plot$BufferedCanvas.resize (Plot.java:234) at com.androidplot.Plot.onSizeChanged (Plot.java:785) at android.view.View.sizeChange (View.java:16158) at android.view.View.setFrame (View.java:16123)

Thank you

pwireless commented 5 years ago

Hello, this is bug seems exclusive in Android 5.1, 5.0.

halfhp commented 5 years ago

I've looked into this one and did not see any smoking guns, so to speak, but I did find a deprecation warning for using ARGB_4444. It's possible that's somehow causing a crash, but seems a bit unlikely to me. More likely is the width or height being passed in are in some way invalid. I've added more detailed logging there as well so that the exception that gets thrown will reveal the answer to those questions, should the problem persist.

halfhp commented 5 years ago

fixed in 1.5.7