It happened to me minutes ago, and I found a reason! This was the code that called it:
Canvas pattern = new Canvas(); Bitmap bitmapPattern = Bitmap.createBitmap(pattern.getWidth(),canvas.getHeight(),Bitmap.Config.ARGB_8888); pattern.setBitmap(bitmapPattern); pattern.drawLine(0, 0, 1, 1, paintStroke); paintFill.setShader(new BitmapShader(bitmapPattern, TileMode.REPEAT, TileMode.REPEAT));
and the reason is: "pattern.getWidth (), canvas.getHeight ()", these parameters can be infinite, I have not defined anything on the canvas yet! Changing it to numbers, I get rid of this error!
Elmec source share