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

/node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView/RCTWKWebView.h:3:9: 'React/RCTView.h' file not found

Open jh97uk opened this issue 7 years ago • 13 comments
trafficstars

After following the instructions on the README I get this error: /Users/james/Documents/OneWord latest/node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView/RCTWKWebView.h:3:9: 'React/RCTView.h' file not found

Cant figure it out at all... Using XCode 9.2 with the deployment target at ios 9.

Thanks!

jh97uk avatar Feb 21 '18 00:02 jh97uk

Are you using rnpm link or the manual linking method?

insraq avatar Feb 21 '18 08:02 insraq

I used npm link (because rnpm is deprecated and link is now apparently a part of NPM or something).

Its really weird, I cant figure it out at all. I've tried cleaning the project, I've tried everything!

jh97uk avatar Feb 21 '18 18:02 jh97uk

Ah.

Interestingly, if you remove the React/ prefix from the import, the error goes away, thereby prompting a chain of other errors on RCTWKWebView and even React... :/

jh97uk avatar Feb 21 '18 18:02 jh97uk

I think rnpm link becomes react-native link. Which React Native version are you using? React Native changes the header path in 0.40

insraq avatar Feb 21 '18 18:02 insraq

Ah, just tried with react-native link and the error has changed:

/Users/james/Documents/OneWordRNN/node_modules/react-native-navigation/ios/RCCNavigationController.h:2:9: 'React/RCTBridge.h' file not found
/Users/james/Documents/OneWordRNN/node_modules/react-native-navigation/ios/RCCNavigationController.m:1:9: In file included from /Users/james/Documents/OneWordRNN/node_modules/react-native-navigation/ios/RCCNavigationController.m:1:
/Users/james/Documents/OneWordRNN/node_modules/react-native-navigation/ios/RCCCustomBarButtonItem.m:1:9: 'React/RCTRootView.h' file not found

Maybe this is a bit past your help at this point, seeing as its not coming under wkwebview?

jh97uk avatar Feb 22 '18 17:02 jh97uk

Oh hang on, I just fixed it by adding the search header paths (SRCROOT)/../node_modules/react-native-navigation/node_modules/react-native-controllers/ios

Which has returned me to /Users/james/Documents/OneWordRNN/node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView/RCTWKWebViewManager.h:1:9: 'React/RCTViewManager.h' file not found Presumably to do with search header paths?

jh97uk avatar Feb 22 '18 17:02 jh97uk

Any updates on this? Id really appreciate it.

jh97uk avatar Feb 28 '18 20:02 jh97uk

I have tried using react-native link in a new React Native project (0.54), it works fine - I cannot reproduce your issue.

insraq avatar Mar 01 '18 18:03 insraq

@insraq maybe he needs to run pod install ? I did it after linking, but it also installs React pod, which I think is deprecated?

xzilja avatar Mar 21 '18 16:03 xzilja

Actually, there is rn guide on this, this needs to be added to pod-file I believe?

pod 'React', :path => '../node_modules/react-native'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

EDIT: @JamesHealdUK after going through all this pod hustle, I came to conclusion that it is much easier and cleaner to link it manually, especially if you didn't use React pod before this.

xzilja avatar Mar 21 '18 16:03 xzilja

@IljaDaderko Im thinking it might have something to do with the fact Im using an ejected expo app? Maybe? Im not sure... Becuase my pod file does have an entry for React:

pod 'React', :path => "../node_modules/react-native", :subspecs => [ "Core", "ART", ...

jh97uk avatar Mar 25 '18 22:03 jh97uk

@JamesHealdUK did you find a resolution to this issue?

Running up against it now, I also started with an expo app I created through create-react-native-app and ejected.

djoneil avatar Jun 15 '18 09:06 djoneil

@JamesHealdUK @dmc91 here is my answer for resolving this issue for ejected Expo apps https://stackoverflow.com/a/49712675/5241130 TLDR the issue occurs with Ejected Expo apps for native libraries and we have to go through the ^ process for having the new library find React headers. Hope it helps

eddie-esc avatar Jun 25 '18 18:06 eddie-esc