itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.9k stars 958 forks source link

Build error: 'React/RCTImageLoaderProtocol.h' file not found for react native version 0.56 #791

Open adkaushik opened 4 years ago

adkaushik commented 4 years ago

The recent changes to the repo to fix the issue with RCTImageLoader for react native version >= 0.60, are failing builds in version 0.56.

RNFS Version: 2.16.1.

Should we just fix with previous version of the library?

perfectAlways1028 commented 4 years ago

I got that error when I try with react-native version 0.60.6.

RNFS Version: 2.14.1

NobodyFlex commented 4 years ago

Same issue RN: 0.59.9 RNFS: 2.16.1

RNFS_ISSUE

itinance commented 4 years ago

As written in README: for RN < 0.61, install 2.15 and for RN >= 0.61, install 2.16

AnthonyAkentiev commented 4 years ago

@itinance RN: 0.60.5 RNFS: 2.15.0

You mentioned above that i should use 2.15, but i am still getting this error :-((( Please help

geraintwhite commented 4 years ago

The README says for RN >= 0.57 install RNFS >= 2.13.2, and for RN >= 0.61 install RNFS >= 2.16.0.

It doesn't say that RNFS 2.16.x is not compatible with RN < 0.61. If that is the case, then the README needs updating to be clearer.

AnthonyAkentiev commented 4 years ago

@itinance @grit96 2.15.2 worked well 2.15 didn't

itinance commented 4 years ago

@AnthonyAkentiev are you sure that react-native-fs 2.15.x is installed?

Please double check the include-statement in line 17 at node_modules/react-native-fs/RNFSManager.m

AnthonyAkentiev commented 4 years ago

@itinance Please see my prev.comment above. 2.15.2 worked well, thank you!

AlanKeiss commented 4 years ago

Changing #import <React/RCTImageLoaderProtocol.h> to #import <React/RCTImageLoader.h> fixed the build issue for me

Don't forget to clean your DerivedData folder

mattslight commented 4 years ago

For RN 0.60.5 use 2.15.2 For RN 0.61 use 2.16

viventus commented 4 years ago

If you are breaking API then you must up MAJOR version! whats wrong with you?

luatnd commented 4 years ago

Instead of changing #import statement again again and again, why don't you use a suitable version like @mattslight said !!

esutton commented 4 years ago

Updating to 2.16.1 broke my build .Rolling back to 21.15.2 fixed it. @mattslight thanks!

"react": "^16.9.0",
"react-native": "0.60.6",
"react-native-fs": "^2.16.1",

/myapp/source/node_modules/react-native-fs/RNFSManager.m:17:9: fatal error: 'React/RCTImageLoaderProtocol.h' file not found

import <React/RCTImageLoaderProtocol.h>

    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

yarn add react-native-fs@2.15.2

abury commented 4 years ago

This is not working. I'm running:

"react": "16.8.3",
"react-native": "0.61.3",
"react-native-fs": "2.16.1"

It looks like the latest version of RN isn't compatible with RNFS? Not sure if I'm missing something.

Also tried downgrading to 2.15.2, the same issue.

Miyou commented 4 years ago

I'm running React Native 0.59.9. Downgrading to 2.14.1 worked for me. Agree that making the readme more clear would be good.

vforvasile commented 4 years ago

Just to clarify,

this doesn't work: "react-native-fs": "^2.15.2" and this works: "react-native-fs": "2.15.2"

removing caret symbol solved it for me & cleaning derivedData rm -rf ~/Library/Developer/Xcode/DerivedData

mgfjx commented 4 years ago

Just to clarify,

this doesn't work: "react-native-fs": "^2.15.2" and this works: "react-native-fs": "2.15.2"

removing caret symbol solved it for me & cleaning derivedData rm -rf ~/Library/Developer/Xcode/DerivedData

Work well ! Thanks !

dylanneild commented 4 years ago

If you are breaking API then you must up MAJOR version! whats wrong with you?

This is a react-native related project. It's literally part of the react-native style guide to make major breaking changes in minor maintenance releases and then poorly documented those changes.

theromie commented 4 years ago

"react": "16.8.3", "react-native": "0.59.9", "react-native-fs": "^2.13.2"

still getting error

sootood commented 4 years ago

i have same issue in rn :59/8 and installed all version of rnfs it works correctly in android but in ios get error 'React/RCTImageLoader.h' file not found

geraintwhite commented 4 years ago

I believe this is now fixed in bbafdc122af013b9f8a3998078ed488de81f186d as of v2.16.4

chaloxc commented 3 years ago

replacing #import <React/RCTImageLoader.h> with #import <React/RCTImage.h> works to me.