React-native-fs: RNFSManager.RNFSFileTypeRegular is undefined

Created on 18 Feb 2017  路  14Comments  路  Source: itinance/react-native-fs

Hi all,

I just downloaded this module. And when I tried to import it into my components, I was given the error "undefined is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')". I'm using React Native 0.40.0. Tried directly download the module from the current master on github, instead of using npm. Didn't work, either. Any idea why it's not working?

Natasha

screenshot 2017-02-18 14 12 15

Most helpful comment

RNFS is a NativeModule so it seems like react-native-fs it's not linked to the project. Did you run react-native link react-native-fs? See: https://github.com/johanneslumpe/react-native-fs#usage-ios

All 14 comments

RNFS is a NativeModule so it seems like react-native-fs it's not linked to the project. Did you run react-native link react-native-fs? See: https://github.com/johanneslumpe/react-native-fs#usage-ios

@hugihlynsson Using react-native link didn't do it. I linked it manually and it worked. Thanks!

@natashache Can you please help me with how did you manually linked this module? I am stuck at the same error.

@tkale1 After doing react-native link, I followed the two steps for manual linking here https://facebook.github.io/react-native/docs/linking-libraries-ios.html.

Also, I basically gave up on this module (because of other issues) and I'm using react-native-fetch-blob instead.

there shouldnt be any linking issues if one does this the right way.

react-native init x
cd x
yarn add react-native-fs
react-native link
... add some custom code
react-native run-ios

works.

Don`t forget pod install

On android, after linking, I had to manually add new RNFSPackage() to getPackages in MainApplication.java

still auto linking doesnt work , manually it works like charm!

manually linked it but still getting an issue which isn't really clear CompileC ....

On android, after linking, I had to manually add new RNFSPackage() to getPackages in MainApplication.java

I just ran react-native link react-native-fs which did automatically add it in to the getPackages function in MainApplication.java, but still get this error when building for Android only :/ really at a loss here

This has been fixed for me, you most likely need to update your gradle version on your project

Automatic linking doesnt work.
Manual linking doesnt work following all the steps.
Installing corresponding version of library with respect to your RN version as manual says doesnt help.

What other steps should one try to have this solved?

This is currently happening on RN 0.60.5

this is also happening for me. I am using Expo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onzag picture onzag  路  3Comments

crobinson42 picture crobinson42  路  4Comments

AgNm picture AgNm  路  4Comments

opoze picture opoze  路  3Comments

1556173267 picture 1556173267  路  3Comments