Not listing the files using rn fetch blob in react native [Error: Attempt to get length of null array]
See original GitHub issueI 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.
I am using the version : "rn-fetch-blob": "^0.12.0"
Thanks in advance 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Not listing the files using rn fetch blob in react native [Error
I was trying to list all the files in a folder using rn fetch blob in react native. When i tried to list...
Read more >[Solved]-Attempt to get length of null array on NfcManager.start()
Attempt to get length of null array on NfcManager. · Not listing the files using rn fetch blob in react native [Error: Attempt...
Read more >Typeerror is not a function react native - Caritas Castellaneta
0 but it was solved with npm install react-native-reanimated@2. js - Error reading an image [TypeError: onChangeImage is not a function · React...
Read more >How to use the react-native-fs.unlink function in react ... - Snyk
type]; await RNFS.unlink(CONFIG_DIRECTORY + dir + configVersion.name); } catch (e) { // do nothing - file doesn't exist } ...
Read more >FileSystem - Expo Documentation
Within Expo Go, each project has a separate file system and has no access to the file system of ... Are you using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Android 10 introduce a new storage paradigm called scoped storage. Due to this is not working.
<application android:requestLegacyExternalStorage="true" ... > ... </application>
inAndroidManifest.xml
. This is a temporary solution.For me after adding this block, it started working.
Original Answer: https://github.com/joltup/rn-fetch-blob/issues/700#issuecomment-732417928
same here