[Android] IOException: open failed: ENOENT (No such file or directory)
See original GitHub issuewhen I pick up a image from system,I got this error:
W/System.err( 5279): java.io.IOException: open failed: ENOENT (No such file or directory)
W/System.err( 5279): at java.io.File.createNewFile(File.java:941)
W/System.err( 5279): at com.imagepicker.ImagePickerModule.getResizedImage(ImagePickerModule.java:331)
W/System.err( 5279): at com.imagepicker.ImagePickerModule.onActivityResult(ImagePickerModule.java:245)
W/System.err( 5279): at com.imagepicker.ImagePickerPackage.handleActivityResult(ImagePickerPackage.java:46)
W/System.err( 5279): at com.jarvis.MainActivity.onActivityResult(MainActivity.java:65)
W/System.err( 5279): at android.app.Activity.dispatchActivityResult(Activity.java:6139)
W/System.err( 5279): at android.app.ActivityThread.deliverResults(ActivityThread.java:3535)
W/System.err( 5279): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3582)
W/System.err( 5279): at android.app.ActivityThread.access$1300(ActivityThread.java:144)
W/System.err( 5279): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1327)
W/System.err( 5279): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 5279): at android.os.Looper.loop(Looper.java:135)
W/System.err( 5279): at android.app.ActivityThread.main(ActivityThread.java:5221)
W/System.err( 5279): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 5279): at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 5279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
W/System.err( 5279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
W/System.err( 5279): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
W/System.err( 5279): at libcore.io.Posix.open(Native Method)
W/System.err( 5279): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
W/System.err( 5279): at java.io.File.createNewFile(File.java:934)
W/System.err( 5279): … 16 more
W/System.err( 5279): at com.jarvis.MainActivity.onActivityResult(MainActivity.java:65)
W/System.err( 5279): at android.app.Activity.dispatchActivityResult(Activity.java:6139)
W/System.err( 5279): at android.app.ActivityThread.deliverResults(ActivityThread.java:3535)
W/System.err( 5279): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3582)
W/System.err( 5279): at android.app.ActivityThread.access$1300(ActivityThread.java:144)
W/System.err( 5279): at android.app.ActivityThread$H.handleMessage(Activity
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Error: open failed: ENOENT (No such file or directory)
The example given in the API reference has this line: // Make sure the Pictures directory exists. path.mkdirs(); . Are you sure the...
Read more >Android : Error: open failed: ENOENT (No such file or directory)
Android : Error: open failed : ENOENT ( No such file or directory ) [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >open failed: ENOENT (No such file or directory) exception ...
The ENOENT (No such file or directory) error may occur in application, If the application do not have storage permission. We suggest you...
Read more >Runtime Error - open failed: ENOENT (No such file or directory)
Hi, I have a simple project. Running well in Companion But, after build apk and installing it to my phone (Android 11), a...
Read more >open failed enoent (no such file or directory) android 11 Code ...
ENOENT : no such file or directory, open 'android\app\src\main\assets\index.android.bundle'. An unhandled exception occurred: ENOENT: no such file or directory, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, i maybe found something, can you tell me if you have a picture directory on your device ?
In the module try to replace android/src/main/java/com/imagepicker/ImagePickerModule.java line 326 :
into :
What kind of image ? (photo, facebook, dropbox…)
I look into this issues and i find the folowing : http://stackoverflow.com/a/11620848 We actually write our file in external storage
try to add the folowing in your AndroidManifest
If that don’t work try to reproduce multiple times, if that work once then work everytime it couldmaybe say that the module need to create image in a custom local directory