Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

"Cache is closed"

Open schusss opened this issue 10 years ago • 11 comments

Hi guys, I'm using this amazing library without any problem for several months now, and it's working great :)

In my last app, I get this error through crashlytics, a lot of it, but I can't reproduce it myself. Does anyone know how it happens, and how I could correct my app to not have this behavior ? I know it's not a library problem, surely one on my app, but I don't understand how it can happen.

Thanks in advance,

java.lang.IllegalStateException: cache is closed
       at com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.checkNotClosed(DiskLruCache.java:642)
       at com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.get(DiskLruCache.java:413)
       at com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiscCache.get(LruDiscCache.java:124)
       at com.nostra13.universalimageloader.core.ImageLoaderEngine$1.run(ImageLoaderEngine.java:72)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
       at java.lang.Thread.run(Thread.java:841)

schusss avatar Oct 15 '14 09:10 schusss

I got this exception too. Can someone help?

gelitenight avatar Apr 02 '15 03:04 gelitenight

I got this exception too

kimlet avatar Apr 13 '15 06:04 kimlet

i got this exception too,Can someone fix

qiyongqiang avatar Jun 15 '15 06:06 qiyongqiang

i got this exception too,Can someone fix

jeanpeng avatar Aug 31 '15 08:08 jeanpeng

i got this exception too,Can someone fix

hikingjin avatar Sep 22 '15 09:09 hikingjin

i got this exception too,Can someone fix

hpyfei avatar Dec 18 '15 07:12 hpyfei

i got this exception too,Can someone fix

ljqloveyou123 avatar Jan 05 '16 03:01 ljqloveyou123

i got this exception too,Can someone fix

nobrejonathan avatar May 17 '16 00:05 nobrejonathan

i got this exception too,Can someone fix

xuguobiao avatar Jun 23 '16 04:06 xuguobiao

i got this exception too,Can someone fix

xiaojidonggong avatar Dec 15 '16 07:12 xiaojidonggong

This Exception comes from the checkNotClosed method of DiskLruCache .When the journalWriter is null, such expception will happen. When the journal size is cut half, journalWriter will close and start rebuild. Any operation during this time will cause such Exception. The journal is under the cache folder,check if it has changed or deleted. If you want to clear the DiskCache, it is best to use the framework api to clear the DiskCache.

xiandanin avatar Mar 10 '17 11:03 xiandanin