react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

undefined is not an object (evaluating RNFSManager.RNFSFileTypeRegular) on Android

Open canpoyrazoglu opened this issue 2 years ago • 5 comments

I'm getting undefined is not an object (evaluating RNFSManager.RNFSFileTypeRegular) on Android (on iOS it works fine).

I've seen other issues for this same error yet they are all old and usually suggest manual linking like react-native link react-native-fs.

react-native link react-native-fs doesn't work as react-native doesn't have the link command anymore. Yet I'm facing the same problem with no solution.

How can I get rid of this error on modern (non-manual-linking) React Native for Android?

canpoyrazoglu avatar May 01 '23 06:05 canpoyrazoglu

Please try adding the following permissions to your androidmanifest.xml file and restart the app:
uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"

lovishoneworld avatar May 22 '23 21:05 lovishoneworld

@canpoyrazoglu Hey , I have the same issue if you found some way to solve it please let me know

rezamohdev avatar Aug 31 '23 16:08 rezamohdev

@rezamohdev I don't remember how it got solved (probably was a cached old build intermediate etc. issue). Have you tried @lovishoneworld's solution?

canpoyrazoglu avatar Aug 31 '23 21:08 canpoyrazoglu

And doing a full clean native (NOT React Native) rebuild is always a good idea.

canpoyrazoglu avatar Aug 31 '23 21:08 canpoyrazoglu

@canpoyrazoglu , I think I don't use external storage so that's not helpful, I tried to upgrade gradle version because at react-native run-android I get Error at this line : new RNFSPackage(), in MainActivity.java file after upgrading gradle I got a bunch of new error that all looking alien for me, I'm very frustrated,

rezamohdev avatar Sep 01 '23 01:09 rezamohdev