lopspower / CircularImageView

Create circular ImageView in Android in the simplest way possible
Apache License 2.0
1.95k stars 413 forks source link

Out of Memory Error #98

Closed tannerhallman closed 5 years ago

tannerhallman commented 5 years ago
dalvik.system.VMRuntime.newNonMovableArray (VMRuntime.java)
android.graphics.Bitmap.nativeCreate (Bitmap.java)
android.graphics.Bitmap.createBitmap (Bitmap.java:975)
android.graphics.Bitmap.createBitmap (Bitmap.java:946)
android.graphics.Bitmap.createBitmap (Bitmap.java:913)
com.mikhaellopez.circularimageview.CircularImageView.drawableToBitmap (CircularImageView.java:296)
com.mikhaellopez.circularimageview.CircularImageView.loadBitmap (CircularImageView.java:196)
com.mikhaellopez.circularimageview.CircularImageView.onDraw (CircularImageView.java:167)

Looks like there's a memory error when drawing.

Fatal Exception: java.lang.OutOfMemoryError
Failed to allocate a 13653988 byte allocation with 6123952 free bytes and 5MB until OOM
com.mikhaellopez.circularimageview.CircularImageView.drawableToBitmap
minaee commented 5 years ago

maybe your image is too large?!

lopspower commented 5 years ago

This is not a problem of the library but also exists in the ImageView object: Canvas: trying to draw too large (319680000bytes) bitmap.

I solved the problem after adding android:hardwareAccelerated="false" in the application of the manifest file.