• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps ENOENT when I try to write to external storage

I'm trying to create a video file on a sdcard card and I get the following error:
Code:
Caused by: java.io.FileNotFoundException: /storage/1DEB-2B0B/documents/video2.mp4: open failed: ENOENT (No such file or directory)
This is a relevant bit of the code:
Code:
 File pathToExternalStorage = Environment.getExternalStorageDirectory();
            File appDirectory = new File(pathToExternalStorage.getAbsolutePath()  + "/documents");
            appDirectory.mkdirs();
            mMuxer = new MediaMuxer(appDirectory.getAbsolutePath()+ "/video2.mp4", MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
When I try to create the directory myself I get EACESS permission error. I'm pretty sure the sdcard is writeable and is mounted.
I've also added the correct permissions to manifest file.
Also I'm using android using along with android emulator(23 api).
Thanks in advance.
 
Back
Top Bottom