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

Invariant Violation: Native module cannot be null.

Open donutsahoy opened this issue 3 years ago • 8 comments

Added react-native-fs to my project and receive an Invariant Violation error. Project is using Expo not sure if this is the issue. My code: Screenshot_20200814_173211

Error: IMG-0689

I have confirmed that my react-native-fs version is compatible with by react-native version.

Any recommendations?

donutsahoy avatar Aug 14 '20 22:08 donutsahoy

Seems like your pods didn't install properly try:

cd ios && pod install && cd ..

And try again.

davidtoluhi avatar Sep 06 '20 09:09 davidtoluhi

I have the same issue! I run cd ios && pod install && cd .. but the issue remain

vitolipari avatar Sep 15 '20 10:09 vitolipari

Came across the same issue.

I have missed to update Podfile with following.

pod 'RNFS', :path => '../node_modules/react-native-fs'

Worked fine after doing a pod install. Refer - https://github.com/itinance/react-native-fs#usage-ios

Nirodha26 avatar Sep 22 '20 09:09 Nirodha26

I have the same issue and really hesitate to eject expo to update the Podfile

Updated: We change to use expo file system instead https://docs.expo.io/versions/latest/sdk/filesystem/

ThangLeQuoc avatar Oct 19 '20 02:10 ThangLeQuoc

I get this error in testing environment only with Jest. Any solution ?

ghasemikasra39 avatar Dec 25 '20 13:12 ghasemikasra39

@ghasemikasra39 I have the same issue!

samking314 avatar Jan 08 '21 15:01 samking314

@ghasemikasra39 I found a solution: create a __mocks__/react-native-fs.js file in your main directory with the following:

const mockedModule = jest.mock('react-native-fs');
module.exports = mockedModule;

then run npm test and should be fine!

samking314 avatar Jan 08 '21 17:01 samking314

Is this issue is in push notification or in navigation its only showing this screen Simulator Screen Shot - iPhone11 - 2022-03-23 at 18 50 26 and the listed solutions are not really working on it I have updated app from 0.57.1 to 0.60.5

Azaz0723 avatar Mar 23 '22 13:03 Azaz0723