Can't load file on device
See original GitHub issueHi, I’m working on a simple soundboard app (source code is available at https://github.com/sexykodo/mlcSoundboard) that automatically fetches remote audio files according to a JSON and puts them in MainBundle with RNFetchBlob.
It’s something like this:
fetchRemoteFile = (obj) => {
RNFetchBlob
.config({
path : RNFetchBlob.fs.dirs.MainBundleDir + encodeURI(obj.Path) //target path
})
.fetch('GET', MAIN_URL + encodeURI(obj.Path), {})
.then((res) => {
// the conversion is done in native code
// the following conversions are done in js, it's SYNC
console.log('The file saved to ', res.path())
})
// Status code is not 200
.catch((errorMessage, statusCode) => {
// error handling
console.log(errorMessage)
})
}
In this way I can dynamically sync local files with remote ones (I want the soundboard to work offline). Everything works like a charm on IOS Simulator.
On physical device though, when I load the local file I get an errorcode “ENSOSSTATUSERRORDOMAIN2003334207”, wich is similar to #64 and probably caused by files not being included in Resources.
Is it actually possible to programmatically save an audio file (with RNFetchBlob) and play it?
Thanks in advance
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:28
Top Results From Across the Web
Can't open a Google file or folder - Android
On your Android device, open the app for Google Drive, Docs, Sheets, or Slides. · At the top left, tap Menu Menu ....
Read more >Can't Open A File on Android? Here Are Steps You Can Take
What Possibly Can Be Done If You Can't Open A File On Android · 1. Check If Its A Genuine File Or A...
Read more >Fix File Explorer if it won't open or start - Microsoft Support
To open File Explorer in Windows 11, select File Explorer on the taskbar or press the Windows logo key + E on your...
Read more >Fixing 'Error in Loading Media: File Could Not Be Played'
Here are some easy solutions you can try to fix 'Error in Loading Media: File Could Not Be Played' on your Windows, Mac,...
Read more >Android file viewer "cant load content at the moment" - Reddit
I fixed this by clearing the data of the Files app on a Galaxy Tab S4. Go to Settings > Apps > Show...
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
I was getting the same error when trying to play the file right away. This workaround fixes it for me (but it’s hacky). Both timeouts are necessary:
@maurovisintin, thank you for your response. Your solution didn’t work for me but I figured out the problem and got it resolved this way: RNFetchBlob.config({ fileCache: true, })… when initializing the sound const sound = new Sound(file.Path,‘’, error => {… The sound bundle must be an empty string ‘’ in iOS.