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

FileNotFoundException: : open failed: ENOENT (No such file or directory) #777

Closed
goodboywt opened this issue Nov 19, 2015 · 4 comments
Closed
Labels
needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)

Comments

@goodboywt
Copy link

I used GenericDraweeView like this :
uri = Uri.parse("file://" + imagePath);
genericDraweeView.setImageURI(uri);

imagePathis a image's path like /data/data/com.coohuaclient/files/img/561e06dde99af1447898564884.mdata.

And I add GenericDraweeViews to a viewPager,but sometimes,some page display nothing but white.
I catch some log as follow,it said that the image file can't found,but the image is in my app's directory.How did this occur? Can you help us?

W/System.err(32014): java.io.FileNotFoundException: : open failed: ENOENT (No such file or directory)
W/System.err(32014): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err(32014): at java.io.FileInputStream.(FileInputStream.java:76)
W/System.err(32014): at java.io.FileInputStream.(FileInputStream.java:103)
W/System.err(32014): at com.facebook.imagepipeline.producers.at.a(SourceFile:101)
W/System.err(32014): at com.facebook.imagepipeline.producers.aw.a(SourceFile:34)
W/System.err(32014): at com.facebook.imagepipeline.producers.au.d(SourceFile:56)
W/System.err(32014): at com.facebook.imagepipeline.producers.au.c(SourceFile:52)
W/System.err(32014): at com.facebook.common.c.j.run(SourceFile:45)
W/System.err(32014): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err(32014): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err(32014): at java.lang.Thread.run(Thread.java:818)
W/System.err(32014): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
W/System.err(32014): at libcore.io.Posix.open(Native Method)
W/System.err(32014): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
W/System.err(32014): at libcore.io.IoBridge.open(IoBridge.java:442)

@goodboywt
Copy link
Author

this is the appearance

appearance

@aagnes-zz aagnes-zz added the needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem) label Nov 19, 2015
@aagnes-zz
Copy link
Contributor

what is the full path of your image, and what kind of format is it.
You may need to use https://developer.android.com/reference/android/os/Environment.html

@goodboywt
Copy link
Author

File dir = new File(MainApplication.getInstance().getFilesDir(), IMG_NAME);
if (!dir.exists()) {
dir.mkdirs();
}
dir.getAbsolutePath();

I get the path like this, the images put in the data/data/[packagename]/files directory.And image's format is JPG,but we change the suffix to [mdata],is that influence Fresco to decode the picture?

@aagnes-zz
Copy link
Contributor

You can try to query JPG path first. I think Fresco is able to decode the pic once if it can find the image file. You'll need to figure out the file path.

@tyronen tyronen closed this as completed May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)
Projects
None yet
Development

No branches or pull requests

3 participants