-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException: Cannot obtain size for recycled Bitmap #2574
Comments
Unfortunately it can be a challenge to track these errors down. A few things to check are listed here: https://github.com/bumptech/glide/wiki/Resource-re-use-in-Glide#causes |
Is this link still valid, because at the top of the page it says it covers Glide 3 only? We have upgraded to Glide 4, we did not have this issue with Glide 3.7.0. |
That page is pretty much the same for v3 and v4. I haven't had the chance to write the v4 equivalent yet, though when I do, it'll probably mostly be a copy/paste. |
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
I have a similar bug after upgrading from v3 to v4 with a simple
Maybe it's a bug with the |
So far I haven't found a single thing that could cause this in our code. We are not using custom Bitmap transforms or anything where we would be recycling Bitmaps on our own. |
Are you able to reproduce this reliably? Or is this something you see in crash logs? |
We are not able to reproduce this reliably. We see it in our crashlogger. In the last 24 hours it happened 23 times for 7 users. All running Android 6. This is with >100k daily active users, so it is by no means a huge issue, but still the crash we see most often. |
And is it always that same stack trace? Originating from the prefiller? |
Yes. The bitmap size in the exception message differs, that depends on the screen size. I can't imagine that matters, though. the trace is the same. |
@Thrakbad the exception is actually happening in Glide's debug logging here: glide/library/src/main/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillRunner.java Line 115 in f5d5403
You might want to strip Log.d/Log.v from your release apks. I have a fix for the issue anyway that I'll push shortly. |
Great, thanks a lot. We will try that in our next release. |
Hello! We suffered from the issue after upgrade from v 4.3.1 to 4.4.0 |
@VolodymyrMachekhin That's a different stack trace, please file a new issue if you'd like help. |
any solutions? |
opps,without any solution still Nov 19th 2018? |
opps,without any solution still Jun 20th 2019? |
similar problem at version 4.9.0 , but can't reproduce crash again E/AndroidRuntime: FATAL EXCEPTION: main |
@timhuang1018 I have similar issue here, have you solved it? |
In my case the problem was I was calling bitmap.recycle() on the image loaded with Glide. After removing recycle call the error vanished ;) |
Same issue here :(
|
I had the same problem,it‘s caused by i used glide download bitmap and i call Bitmap.recycle() method. After removing this calling , i am not repeat this problem |
|
has this been fixed ? |
Glide.with(mContext).clear(imageView); |
I had the same prolem at version 4.11.0 Caused by java.lang.IllegalStateException |
do not recycle the resource bitmap in onResourceReady() it is useful for me |
我也是在onResourceReady里面将Bitmap回收了导致的。 |
I am facing this issue |
Hi,
we recently updated our app from Glide 3.7.0 to Glide 4.1.1. In the new release, we are getting some Crashes in our Crashlogger with the following Stacktrace:
Stack trace / LogCat:
So far all of the crashes are on devices running Android 6.0. Do you have any hints what I should look for to find what's causing this issue?
The text was updated successfully, but these errors were encountered: