Skip to content
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

Images aren't loaded after "Clear Cache" in app info #168

Closed
pablisco opened this issue Feb 8, 2013 · 8 comments
Closed

Images aren't loaded after "Clear Cache" in app info #168

pablisco opened this issue Feb 8, 2013 · 8 comments
Labels

Comments

@pablisco
Copy link

pablisco commented Feb 8, 2013

When doing a cache clear from the system menu and then opening the app (I think it was opened in the background) the app crashes. Closing the app from recent apps solves the problem but it's not ideal.

This is the error I get:

02-08 16:15:46.490: E/ImageLoader(11201): java.io.FileNotFoundException: /storage/sdcard0/Android/data/app.package/cache/-1563422183: open failed: ENOENT (No such file or directory)
02-08 16:15:46.490: E/ImageLoader(11201):   at libcore.io.IoBridge.open(IoBridge.java:416)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
02-08 16:15:46.490: E/ImageLoader(11201):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.saveImageOnDisc(LoadAndDisplayImageTask.java:303)
02-08 16:15:46.490: E/ImageLoader(11201):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:204)
02-08 16:15:46.490: E/ImageLoader(11201):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:128)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-08 16:15:46.490: E/ImageLoader(11201):   at java.lang.Thread.run(Thread.java:856)
02-08 16:15:46.490: E/ImageLoader(11201): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
02-08 16:15:46.490: E/ImageLoader(11201):   at libcore.io.Posix.open(Native Method)
02-08 16:15:46.490: E/ImageLoader(11201):   at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
02-08 16:15:46.490: E/ImageLoader(11201):   at libcore.io.IoBridge.open(IoBridge.java:400)
02-08 16:15:46.490: E/ImageLoader(11201):   ... 10 more
@nostra13
Copy link
Owner

nostra13 commented Feb 8, 2013

Show me please your Configuration and Display Options.

@pablisco
Copy link
Author

pablisco commented Feb 8, 2013

DisplayImageOptions options = new DisplayImageOptions.Builder().cacheInMemory()
                .resetViewBeforeLoading()
                .cacheOnDisc()
                .build();
}
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
                .defaultDisplayImageOptions(defaultOptions)
                .tasksProcessingOrder(QueueProcessingType.LIFO)
                .build();

@nostra13
Copy link
Owner

nostra13 commented Feb 8, 2013

When doing a cache clear from the system menu and then opening the app (I think it was opened in the background) the app crashes.

Describe sequence of your actions int more details.

@pablisco
Copy link
Author

pablisco commented Feb 8, 2013

I am on the app Some images are used. I exit the app (using the back button). Go to Preferences > Apps > my app > Clear cache. I open my app again and the image loading fails.

@pablisco pablisco closed this as completed Feb 8, 2013
@pablisco pablisco reopened this Feb 8, 2013
@nostra13
Copy link
Owner

nostra13 commented Feb 9, 2013

Got it. Hot fix for this case is to init ImageLoader in your first Activity.onCreate() (instead of in Application.onCreate). But I'll fix it in the next lib version.

@pablisco
Copy link
Author

pablisco commented Feb 9, 2013

Thanks, will try it on Monday but seems reasonable. Will it be ok if the init is done on each activity. I have a base activity so was thinking on placing it there.

PS: great work with the library... saved me hours :)

@nostra13
Copy link
Owner

nostra13 commented Feb 9, 2013

Will it be ok if the init is done on each activity. I have a base activity so was thinking on placing it there.

It's ok.

@abuzarsk
Copy link

After clearing cache from setting still image is displaying in the app when internet if off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants