itinance / itinance/react-native-fs

"Attempt to get length of null array" in doing readDir(<path>)

Open
#152 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Using Genymotion emulator:

Still having problem with this. Get "attempt to get length of null array" react native file system which as I understand is not a good message, but means that I can't reference that directory in a readDir.

Seems to work for Android version 4, but not 6. Also needed to change the read from:
/storage/emulated/0/Download to /storage/emulated/legacy/Download (in the Android 4 emulator).

In looking at previous answers it is a permissions problem.

My directory permission for the referenced directory /storage/emulated/0/Download is:
drwxrwx--x root sdcard_rw

Within that directory, I have 1 directory, 1 file:
Brian drwxrwx--x root sdcard_rw
and
Brian.jpg -rw-rw---- root sdcard_rw

I don't think these permissions are incorrect. Any help?

```
RNFS.readDir(inPathObj.path)
.then((result) => {
return Promise.all(result);
})
.then((statResults) => {
console.log('WE DONT GET HERE');
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.