FileOutputStream.<init>() has thrown a FileNotFoundException

libcore.io.ErrnoException
at libcore.io.Posix.open
(source)
at libcore.io.BlockGuardOs.open
(source)
at libcore.io.IoBridge.open
(source)
java.io.FileNotFoundException
Javadoc
at libcore.io.IoBridge.open
(source)
at java.io.FileOutputStream.<init>
(source)
at java.io.FileOutputStream.<init>
(source)
5 frames hidden

Typical Exception Messages

  1. /sys/class/tcon/tcon/auto_br: open failed: ENOENT (No such file or directory)
  2. /untitled6.txt: open failed: EROFS (Read-only file system)
  3. /data/data/com.stealth.android/cache: open failed: EISDIR (Is a directory)
  4. /mnt/sdcard/myapp/userregister.txt: open failed: EACCES (Permission denied)
  5. /storage/sdcard/Family/Brother/jay: open failed: EACCES (Permission denied)
  6. /storage/emulated/0/DCIM/Frames/20140416_100025.mp4: open failed: ENOENT (No such file or directory)
  7. /storage/sdcard0/Android/data/app.package/cache/-1563422183: open failed: ENOENT (No such file or directory)
  8. /iReader/cover/epub.xhtml: open failed: ENOENT (No such file or directory)
  9. /storage/emulated/0/bimagechooser/1429031333305.jpg: open failed: ENOENT (No such file or directory)
  10. /CameraApp: open failed: EROFS (Read-only file system)

Origin

FileOutputStream.<init>() has thrown a FileNotFoundException

libcore.io.ErrnoException
4 frames hidden
java.io.FileOutputStream.<init>
98Web pages

Similar

Specific cases

Solution

rafael, 1 year ago

Check if android.permission.WRITE_EXTERNAL_STORAGE is in AndroidManifest.xml. Also, add checks in your code to see if the storage is available to write before trying to write. And last: create a folder to put your files inside.

Check the source of this solution for more info

External results for this pattern (78)

  1. Locashvia GitHub1 month ago
    /storage/sdcard0/Pictures/memetastic/.downloads/2017-10-31T17:47.memetastic.zip: open failed: EINVAL (Invalid argument)
    Show stack trace
  2. Soheylvia Stack Overflow3 months ago
    /storage/emulated/0: open failed: EISDIR (Is a directory)
    Show stack trace
  3. /storage/sdcard/database/objectdetail_create.sql: open failed: EROFS (Read-only file system)
    Show stack trace
  4. Panachevia Stack Overflow3 months ago
    /storage/MicroSD/WhatsAppold/a.apk: open failed: EACCES (Permission denied)
    Show stack trace
  5. Ankur Jainvia Stack Overflow3 months ago
    /storage/MicroSD/Android/A.mp4: open failed: EACCES (Permission denied)
    Show stack trace
  6. omegavia Stack Overflow3 months ago
    /storage/sdcard0/arin/53/image.jpg: open failed: EACCES (Permission denied)
    Show stack trace
  7. Unknown authorvia opencv.org3 months ago
    /storage/emulated/0/DCIM/Frames/20140416_100025.mp4: open failed: ENOENT (No such file or directory)
    Show stack trace
  8. /storage/emulated/0/DCIM/Frames/20140416_100025.mp4: open failed: ENOENT (No such file or directory)
    Show stack trace
  9. Gomoku7via Stack Overflow3 months ago
    /mnt/sdcard/Pictures/"Samsung ()+-* Samsung.jpg": open failed: EINVAL (Invalid argument)
    Show stack trace
  10. Dirkstaalvia GitHub3 months ago
    /storage/emulated/0/MaterialPlayer/logs/log1465154809600.txt: open failed: ENOENT (No such file or directory) 06-05 21:26:49.598 2136-2616/? D/audio_hw_mrvl: out_get_latency_low_latency period_size 1024 period_count 3
    Show stack trace