naXa777 / SoundRecorder

A simple sound recording Android app implementing Material Design
https://naxa777.github.io/SoundRecorder/
GNU General Public License v3.0
36 stars 43 forks source link

Error! External storage (SD card) is not available for writing. #69

Open SahilRajpal-hub opened 4 years ago

SahilRajpal-hub commented 4 years ago

When is started the recording it gave me toats "Error! External storage (SD card) is not available for writing." . I searched the error lines and found a bug in these lines of RecordFragment.java class in startRecording() function

if (!folder.exists()) { // a folder for sound recordings doesn't exist -> create the folder boolean ok = Paths.isExternalStorageWritable() && folder.mkdir(); if (!ok) { EventBroadcaster.send(getContext(), R.string.error_mkdir); return false; } }

i found that mkdir() was giving false. i.e. folder is not created

SahilRajpal-hub commented 4 years ago

I am newbie so plz make me correct if i am wrong. The directory used to store recording is Music/SoundRecording , therefore I replaced mkdir() with mkdirs() and everything worked OK , since mkdirs() also creates the parent directories.