Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-native : null is not an object(evaluating 'RNFSMANAGER.RNFSFileTypeRegular')

Tags:

react-native

I am getting this error as soon as I add this line to my App.js in react-native project.

import * as RNFS from 'react-native-fs';

null is not an object(evaluating 'RNFSMANAGER.RNFSFileTypeRegular')

I am attaching the screens that I get. First I get :

enter image description here

then it quickly converts into :

enter image description here

I also tried to link react-native fs using:

enter image description here

I don't know if i have to do this but when I try to do yarn add react-native-fs.

enter image description here

Though I was able to do : enter image description here

like image 643
Bhavya Arora Avatar asked Jul 18 '19 03:07

Bhavya Arora


2 Answers

Install react-native-fs : npm install --save react-native-fs

Then restart project : react-native run-android

like image 132
AHméd Net Avatar answered Nov 08 '22 06:11

AHméd Net


I had the same issue and here's how I resolved.
To see the details of the issue, open the workspace file in iOS and try to run the simulator. I'll pop up an error. For me, an embedded library was missing.
Not sure WHY but it sometimes happen when you install other dependencies using npm or yarn.

So, I just ran

npm install

Then

cd ios pod install

And that was it for my case.

like image 38
Hoon Avatar answered Nov 08 '22 06:11

Hoon