I’m trying to implement the react-native-fs module in my detached Expo application. The module loads and works when compiling development build variants and running with Expo XDE, but comes up as undefined in the prodRelease variant. Here is the error:
undefined is not an object (evaluating t.RNFSFileTypeRegular)
I’ve tried disabling minification to see if that helps but can’t get past the dex capacity reached issue.
I’m running Expo SDK v24 and Android Studio 3.0.1.
I should mention this works perfectly with iOS in both production and development builds.
Unfortunately expo filesystem api didn’t have what I needed. However, I was able to get this to work by disabling proguard (minifyEnabled false) in my release build config, if that helps anyone.
I needed to use the writeFile method to write base64 data to save a jpeg to the app document directory, something like so: RNFS.writeFile(destinationPath, imageData, 'base64')
Based on what I read here in the expo forums I figured using RNFS module was the only way.