When I try and write to a file in react native using the react-native-fs work around (to replace fs), I run into an error. It says Cannot read property 'RNFSFileTypeRegular' of null.
The full error in my terminal says "TypeError: Cannot read property 'RNFSFileTypeRegular' of null, js engine: hermes" I read somewhere that I have to change the read and write permissions in the androidmanifest.xml file: https://github.com/itinance/react-native-fs/issues/1142. Will this work? Can someone tell me how? I am using expo and can't even see that file!
Here is what I am trying to accomplish. I am using this package https://github.com/grimmdude/MidiWriterJS. I would like to save a midi file to an android device. The following instructions https://github.com/grimmdude/MidiWriterJS/issues/54 only work on PC.
This link is an example of a song https://github.com/grimmdude/MidiWriterJS/blob/master/examples/hot-cross-buns.js. Can someone show me how to make this work on react native, and actually save a file callenter image description hereed "hot-cross-buns.midi" on ANDROID using REACT NATIVE?
I'd appreciate it!
PS: I would be willing to also use fs which is a node module and use a hack to allow it, but I ran into bugs. See https://github.com/tradle/rn-nodeify or https://github.com/philikon/ReactNativify. I am not keen on a security problem, but if this is the way to go, please let me know. Somehow my app would not successfully load when I used nodeify, it said something about AsynchStorage being removed from react native core, someone proposed a solution which involves modifying the react native core file, but I cannot find it (just like I can't find the androidmanifest.xml file).
Top comments (1)
Well done on posting your first article!