Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

java.lang.IllegalArgumentException: Cannot draw recycled bitmaps #69

Closed
mecid opened this Issue · 7 comments

4 participants

@mecid

I have big listview with image loaded from the web by imageloader.
I have this exception too often when scrolling the list.

@friedger
Collaborator

Could you send a stack trace?

@mecid

10-11 20:41:48.832: WARN/System.err(4139): java.lang.IllegalArgumentException: Cannot draw recycled bitmaps
10-11 20:41:48.836: WARN/System.err(4139): at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:778)
10-11 20:41:48.836: WARN/System.err(4139): at android.view.GLES20RecordingCanvas.drawBitmap(GLES20RecordingCanvas.java:117)
10-11 20:41:48.840: WARN/System.err(4139): at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:393)
10-11 20:41:48.840: WARN/System.err(4139): at android.widget.ImageView.onDraw(ImageView.java:979)
10-11 20:41:48.840: WARN/System.err(4139): at android.view.View.draw(View.java:13458)
10-11 20:41:48.840: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12409)
10-11 20:41:48.840: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.843: WARN/System.err(4139): at android.view.View.draw(View.java:13182)
10-11 20:41:48.843: WARN/System.err(4139): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-11 20:41:48.843: WARN/System.err(4139): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-11 20:41:48.843: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12407)
10-11 20:41:48.847: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.847: WARN/System.err(4139): at android.view.View.draw(View.java:13182)
10-11 20:41:48.847: WARN/System.err(4139): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-11 20:41:48.847: WARN/System.err(4139): at android.widget.ListView.drawChild(ListView.java:3226)
10-11 20:41:48.847: WARN/System.err(4139): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-11 20:41:48.847: WARN/System.err(4139): at android.widget.AbsListView.dispatchDraw(AbsListView.java:2433)
10-11 20:41:48.851: WARN/System.err(4139): at android.widget.ListView.dispatchDraw(ListView.java:3221)
10-11 20:41:48.851: WARN/System.err(4139): at android.view.View.draw(View.java:13563)
10-11 20:41:48.851: WARN/System.err(4139): at android.widget.AbsListView.draw(AbsListView.java:3759)
10-11 20:41:48.851: WARN/System.err(4139): at com.handmark.pulltorefresh.library.PullToRefreshListView$InternalListView.draw(PullToRefreshListView.java:258)
10-11 20:41:48.851: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12409)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.855: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.859: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12345)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.View.getDisplayList(View.java:12453)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1144)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2147)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2019)
10-11 20:41:48.863: WARN/System.err(4139): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1830)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.Choreographer.doFrame(Choreographer.java:525)
10-11 20:41:48.867: WARN/System.err(4139): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
10-11 20:41:48.867: WARN/System.err(4139): at android.os.Handler.handleCallback(Handler.java:615)
10-11 20:41:48.867: WARN/System.err(4139): at android.os.Handler.dispatchMessage(Handler.java:92)
10-11 20:41:48.867: WARN/System.err(4139): at android.os.Looper.loop(Looper.java:137)
10-11 20:41:48.867: WARN/System.err(4139): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-11 20:41:48.867: WARN/System.err(4139): at java.lang.reflect.Method.invokeNative(Native Method)
10-11 20:41:48.867: WARN/System.err(4139): at java.lang.reflect.Method.invoke(Method.java:511)
10-11 20:41:48.871: WARN/System.err(4139): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-11 20:41:48.871: WARN/System.err(4139): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-11 20:41:48.871: WARN/System.err(4139): at dalvik.system.NativeStart.main(Native Method)

@mecid

and this when hardware acceleration disabled

10-12 01:50:45.871: WARN/System.err(7153): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@41580f7
10-12 01:50:45.875: WARN/System.err(7153): at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026)
10-12 01:50:45.875: WARN/System.err(7153): at android.graphics.Canvas.drawBitmap(Canvas.java:1127)
10-12 01:50:45.875: WARN/System.err(7153): at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:393)
10-12 01:50:45.875: WARN/System.err(7153): at android.widget.ImageView.onDraw(ImageView.java:979)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.View.draw(View.java:13458)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.View.draw(View.java:13342)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.875: WARN/System.err(7153): at android.widget.ListView.drawChild(ListView.java:3226)
10-12 01:50:45.875: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.879: WARN/System.err(7153): at android.widget.AbsListView.dispatchDraw(AbsListView.java:2433)
10-12 01:50:45.879: WARN/System.err(7153): at android.widget.ListView.dispatchDraw(ListView.java:3221)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13563)
10-12 01:50:45.879: WARN/System.err(7153): at android.widget.AbsListView.draw(AbsListView.java:3759)
10-12 01:50:45.879: WARN/System.err(7153): at com.handmark.pulltorefresh.library.PullToRefreshListView$InternalListView.draw(PullToRefreshListView.java:258)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13342)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.879: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13461)
10-12 01:50:45.882: WARN/System.err(7153): at android.support.v4.view.ViewPager.draw(ViewPager.java:1574)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13342)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13461)
10-12 01:50:45.882: WARN/System.err(7153): at android.widget.FrameLayout.draw(FrameLayout.java:467)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13342)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.View.draw(View.java:13340)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
10-12 01:50:45.882: WARN/System.err(7153): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.View.draw(View.java:13461)
10-12 01:50:45.886: WARN/System.err(7153): at android.widget.FrameLayout.draw(FrameLayout.java:467)
10-12 01:50:45.886: WARN/System.err(7153): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2183)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2256)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2151)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2019)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1830)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.Choreographer.doFrame(Choreographer.java:525)
10-12 01:50:45.886: WARN/System.err(7153): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
10-12 01:50:45.886: WARN/System.err(7153): at android.os.Handler.handleCallback(Handler.java:615)
10-12 01:50:45.886: WARN/System.err(7153): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 01:50:45.886: WARN/System.err(7153): at android.os.Looper.loop(Looper.java:137)
10-12 01:50:45.886: WARN/System.err(7153): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-12 01:50:45.886: WARN/System.err(7153): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 01:50:45.886: WARN/System.err(7153): at java.lang.reflect.Method.invoke(Method.java:511)
10-12 01:50:45.890: WARN/System.err(7153): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-12 01:50:45.890: WARN/System.err(7153): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-12 01:50:45.890: WARN/System.err(7153): at dalvik.system.NativeStart.main(Native Method)

@mecid

I think this problem caused when bitmap get from cache

@friedger
Collaborator

If you have more indications where and when this happens that would be helpful. Still investigating...

@mecid

I am working on twitter client. I have list with 200-300 tweets. Every list item have one imageview - profile picture.
This profile pictures loaded with your lib. When i scroll quickly, i have this exception.

@outlying

Same here, the problem occurs on ListView filled with ImageViews. Each ImageView match screen size. When sliding down ( even very quickly ) everything seems ok, but when I try to slide up I got an exception, after an image or two.

I got this issue on Samsun Galaxy II with Android 4.1 (custom ROM - it might be a problem), but it never occured on Samsung Galaxy Ace with Android 2.3.5.

@ouchadam ouchadam closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.