I was trying to list all the files in a folder using rn fetch blob in react native. When i tried to list it i am getting an error saying
[Error: Attempt to get length of null array]
here is the below code I have tried to list the files.
try {
var TRACK_FOLDER = RNFetchBlob.fs.dirs.DownloadDir + '/BlabberApp/';
let files = await RNFetchBlob.fs.ls(TRACK_FOLDER)
console.log(files);
} catch (error) {
console.log(error);
}
Its working perfectly in system emulator and when i tested in real devices its force closing and throwing this error. I am pretty sure that i gave given storage permission for this but still I am getting this error.
Any help would be appreciable.
Thanks in advance :)
Usually, this is a Storage Permission Error: You need to ask permission.