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

Getting a FileNotFoundException #5

Open
vibin opened this issue Jun 11, 2014 · 6 comments
Open

Getting a FileNotFoundException #5

vibin opened this issue Jun 11, 2014 · 6 comments

Comments

@vibin
Copy link

vibin commented Jun 11, 2014

Okay, so this is what my setImageUrl looks like

holder.artwork.setImageUrl(temp.artwork, ImageCacheManager.getInstance().getImageLoader());

In the Application Object, I have this code.

public class BillyApplication extends Application {
    private static int DISK_IMAGECACHE_SIZE = 1024*1024*10;
    private static Bitmap.CompressFormat DISK_IMAGECACHE_COMPRESS_FORMAT = Bitmap.CompressFormat.PNG;
    private static int DISK_IMAGECACHE_QUALITY = 100;  //PNG is lossless so quality is ignored but must be provided
    RequestQueue req;
    @Override
    public void onCreate() {
        super.onCreate();
        init();
    }

    private void init() {
        Log.d(getClass().getName(), "This is init");
       req = Volley.newRequestQueue(this);
       createImageCache();
    }

    private void createImageCache() {
        ImageCacheManager.getInstance().init(this,
                this.getPackageCodePath()
                , DISK_IMAGECACHE_SIZE
                , DISK_IMAGECACHE_COMPRESS_FORMAT
                , DISK_IMAGECACHE_QUALITY
                , ImageCacheManager.CacheType.MEMORY);
    }

    public RequestQueue getRequestQueue(){
        if(req == null) {
            Log.d(getClass().getName(), "Request Queue object is not initialized");
            req = Volley.newRequestQueue(this);
        }
        return req;
    }
}
@rdrobinson3
Copy link
Owner

Can you post the stack trace?

@vibin
Copy link
Author

vibin commented Jun 11, 2014

:49.287    3873-3873/com.vibin.billy D/cache_test_DISK_﹕ java.io.FileNotFoundException: /data/data/com.vibin.billy/cache/data/app/com.vibin.billy-1.apk/#W0#H0http:/a5.mzstatic.com/us/r30/Music/v4/e4/9f/ab/e49fab38-1684-6e58-38a1-88c3e329e289/UMG_cvrart_00602537786404_01_RGB72_1500x1500_14UMGIM08053.400x400-75.jpg.0.tmp: open failed: ENOENT (No such file or directory)#W0#H0http://a5.mzstatic.com/us/r30/Music/v4/e4/9f/ab/e49fab38-1684-6e58-38a1-88c3e329e289/UMG_cvrart_00602537786404_01_RGB72_1500x1500_14UMGIM08053.400x400-75.jpg
06-11 18:28:49.303    3873-3891/com.vibin.billy D/dalvikvm﹕ GC_FOR_ALLOC freed 77K, 12% free 5251K/5924K, paused 4ms, total 4ms
06-11 18:28:49.303    3873-3891/com.vibin.billy I/dalvikvm-heap﹕ Grow heap (frag case) to 5.536MB for 320012-byte allocation
06-11 18:28:49.311    3873-3882/com.vibin.billy D/dalvikvm﹕ GC_FOR_ALLOC freed 1K, 11% free 5562K/6240K, paused 6ms, total 6ms
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ java.io.FileNotFoundException: /data/data/com.vibin.billy/cache/data/app/com.vibin.billy-1.apk/#W0#H0http:/a4.mzstatic.com/us/r30/Music2/v4/ef/76/96/ef76963c-b96f-1bab-87bf-c053dad95e15/UMG_cvrart_00602537852666_01_RGB72_1500x1500_14UMGIM15833.400x400-75.jpg.0.tmp: open failed: ENOENT (No such file or directory)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:409)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.jakewharton.DiskLruCache$Editor.newOutputStream(DiskLruCache.java:764)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.vibin.billy.DiskLruImageCache.writeBitmapToFile(DiskLruImageCache.java:49)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.vibin.billy.DiskLruImageCache.putBitmap(DiskLruImageCache.java:74)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader.onGetImageSuccess(ImageLoader.java:255)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader.access$000(ImageLoader.java:43)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader$2.onResponse(ImageLoader.java:223)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader$2.onResponse(ImageLoader.java:220)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageRequest.deliverResponse(ImageRequest.java:186)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageRequest.deliverResponse(ImageRequest.java:34)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Looper.loop(Looper.java:136)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5017)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.Posix.open(Native Method)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:393)
06-11 18:28:49.339    3873-3873/com.vibin.billy W/System.err﹕ ... 21 more
06-11 18:28:49.339    3873-3873/com.vibin.billy D/cache_test_DISK_﹕ java.io.FileNotFoundException: /data/data/com.vibin.billy/cache/data/app/com.vibin.billy-1.apk/#W0#H0http:/a4.mzstatic.com/us/r30/Music2/v4/ef/76/96/ef76963c-b96f-1bab-87bf-c053dad95e15/UMG_cvrart_00602537852666_01_RGB72_1500x1500_14UMGIM15833.400x400-75.jpg.0.tmp: open failed: ENOENT (No such file or directory)#W0#H0http://a4.mzstatic.com/us/r30/Music2/v4/ef/76/96/ef76963c-b96f-1bab-87bf-c053dad95e15/UMG_cvrart_00602537852666_01_RGB72_1500x1500_14UMGIM15833.400x400-75.jpg
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ java.io.FileNotFoundException: /data/data/com.vibin.billy/cache/data/app/com.vibin.billy-1.apk/#W0#H0http:/a1.mzstatic.com/us/r30/Features/v4/c6/16/d4/c616d4bc-ae3c-2c3a-9b48-7ffece9e29b3/dj.velovadm.400x400-75.jpg.0.tmp: open failed: ENOENT (No such file or directory)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:409)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.jakewharton.DiskLruCache$Editor.newOutputStream(DiskLruCache.java:764)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.vibin.billy.DiskLruImageCache.writeBitmapToFile(DiskLruImageCache.java:49)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.vibin.billy.DiskLruImageCache.putBitmap(DiskLruImageCache.java:74)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader.onGetImageSuccess(ImageLoader.java:255)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader.access$000(ImageLoader.java:43)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader$2.onResponse(ImageLoader.java:223)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageLoader$2.onResponse(ImageLoader.java:220)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageRequest.deliverResponse(ImageRequest.java:186)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.toolbox.ImageRequest.deliverResponse(ImageRequest.java:34)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at android.os.Looper.loop(Looper.java:136)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5017)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.Posix.open(Native Method)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:393)
06-11 18:28:49.439    3873-3873/com.vibin.billy W/System.err﹕ ... 21 more

@vibin
Copy link
Author

vibin commented Jun 12, 2014

any update on this?

@1hakr
Copy link

1hakr commented Jun 13, 2014

I couldnt get what the issue, but give this library a try https://github.com/DWorkS/VolleyPlus

@vibin
Copy link
Author

vibin commented Jun 13, 2014

@1hakr Thanks, but I really don't need all those features like synchronous requests etc.

Caching is the only thing I need and I wish I could get around this error

@vibin
Copy link
Author

vibin commented Jun 13, 2014

I tried switching to BitmapLruImageCache, by changing cache type to ImageCacheManager.CacheType.MEMORY in BillyApplication.

But, as I can see, the getBitmap(String url) and putBitmap(String url, Bitmap bitmap) methods aren't getting called at all.

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

No branches or pull requests

3 participants