React-native-navigation: <React/RCTRootView.h> file not found

Created on 18 Apr 2017  路  26Comments  路  Source: wix/react-native-navigation

Issue Description

After upgrading RN to 0.43.3, i'm getting error in react-native-navigation for header file not found.I tried following things, but does not seem to work,

1) In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).
2) Click on the 'Build' option at the left pane.
3) Uncheck 'Parallelize Build' under Build Options.
4) Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'.
5) 'React' should now appear under Targets section. Click and drag it to the top so that it will be the first item in the list (before your project).
6) Clean the project and build.

screen shot 2017-04-18 at 4 57 24 pm

Environment

iOS acceptediscussion v2 馃彋 stale

Most helpful comment

I have the 'React/RCTRootView.h' file not found error. How did you fix that?

All 26 comments

@gran33 : Any update on this ? Looks like RN Navigation isn't able to resolve any of the react classes !

@gran33 : Just to give additional context, We add react dependancy via pod,

pod 'React',
:path => 'node_modules/react-native',
:subspecs => [
'ART',
'Core',
'RCTActionSheet',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTPushNotification',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
And Cocoapods automatically sets the header search paths for the dependancies. Is this because of pods, RN Navigation is not able to resolve the React headers ? I'm stuck on this for like 2 days.Any help would be greatly appreciated !

I am assuming that you were already on react native version > .40 i.e. you didn't have to update any other imported libraries to update the headers. I also ran into similar issues when I upgraded from react-native .37 to .42 and had to update all the imported libraries also. For me, some of the issues arose from just Xcode not able to link stuff correctly which were resolved by either restaring Xcode or removing and the adding the affected project back. Not much of an answer but something that you could try.

@varungupta85 : Yes, i'm on 0.43.3 RN version. I tried removing and adding affected project back. Did a fresh install of this package and linked it again.And did couple of other things. But nothing worked. If i remove this lib from my project, it compiles fine. So the problem is with header search paths of this library and that's the reason it's not able to resolve the react headers.

@PadmaPreethi I followed this tweet while upgrading where I had to empty out the header search paths in order for things to work properly in Xcode.

https://twitter.com/skellock/status/818813810781908992/photo/1

@PadmaPreethi Have u follow this instruction before u install react-native-navigation via pods?

@varungupta85 : Yes, i already tried doing all those.

@gran33 : Unable to find any of react headers in react-native-navigation lib. All other libraries compiles fine. I tried setting react paths - "$(SRCROOT)/../react-native/React" in "Header search paths" in build settings of ReactNativeNavigation.xcodeproj target. But issue still exist !

I'm seeing this issue too.
React-native installed as a dependency via Cocoapods; XCode can't find the react-native headers in the subproject. React Native 0.43.3

@PadmaPreethi modifying the header search paths of ReactNativeNavigation.xcodeprojin such a way would mean <React/RCTRootView.h> would need to be modified to be a local include: i.e. "RCTRootView.h". Did you have any luck with this?

I played around with adding a PodSpec to this project and I got it to compile the project and by adding it as a dependency to my PodFile like so: pod 'react-native-navigation', :path => '../node_modules/react-native-navigation'.
Disclaimer: this is purely trial and error, I'm not exactly sure of the subtleties when creating a podspec. I've yet to include a header from react-native-navigation as XCode doesn't seem to be picking them up; I need to double check which headers are being copied with the properties of the podspec.

I'd imagine adding a valid podspec to react-native-navigation, like Airbnb have done for react-navigation would be a useful thing to do, so if this works I'll submit a PR.

PodSpec is here: https://gist.github.com/joshyhargreaves/f972f4985f1c8e94d427cae3b2ea7513

edit: I made a small change that fixed the header issue. So looking like a good solution to me.

@joshyhargreaves : Thanks ! Let me try adding the Podspec and check.

@PadmaPreethi any luck?

@joshyhargreaves : Yes , it worked. Please raise a PR for the posdpec. Sorry didn't get time to work on this. Hence delayed.

Podspec is in the v2 branch now!

You can probably close the issue.

Is v2 branch ready to use ? @joshyhargreaves

Is a good question actually, one which I'm unsure of, it might be worth also adding a podspec to the v1 branch also.

@joshyhargreaves : Though i got it up and running fine. I'm having issue with integrating a mix of native and react views in tab bar. I have raised an issue as well- https://github.com/wix/react-native-navigation/issues/1029.

@josephdscs @PadmaPreethi
I added the .podspec file from v2 branch and included
pod 'ReactNativeNavigation', :podspec => "../node_modules/react-native-navigation/ReactNativeNavigation.podspec"
to the Podfile, but still getting the same file not found error.

Can you please help to check what else I'm missing? I have been stuck at this for days... https://github.com/James2516/expo-native-nav

I've been stuck on this for a couple days too...

I've updated header search paths, installed using Podfile, no luck. Error is --

'React/RCTEventEmitter.h' file not found

I'm also using ReactNative with ExpoKit.

EDIT -- This seems to have been resolved by disabling "Parallelize Build" and "Find Implicit Dependencies" (I'm using the Podfile to add dependencies). @James2516

@angelafield do you tick or untick "Find Implicit Dependencies"?
Do you still create a Libraries folder and add the ReactNativeNavigation.xcodeproj under it in your main project, or is the pod install sufficient?

I have tried various configs without luck.
Can you take a look at https://github.com/James2516/expo-native-nav or https://github.com/James2516/expo-native-nav/tree/react-native-navigation to see what's missing?

Or do you have a demo project of successful integration of react-native-navigation with expo?
Thanks.

I see this issue most the time when I want to run example of libraries like wix/react-native-camera-kit/example out of the box. In this situation, when I open the xcodeproj file, I see the Libraries icons color is pale. This show me I need to run npm install to download all require modules and libraries.

To xcode understand the files is changed, I close and reopen it. (I clean the project, but xcode does not refresh libraries)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

The issue has been closed for inactivity.

I have the 'React/RCTRootView.h' file not found error. How did you fix that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harveyconnor picture harveyconnor  路  57Comments

maurovisintin picture maurovisintin  路  101Comments

mohdabbas picture mohdabbas  路  93Comments

fuatsengul picture fuatsengul  路  40Comments

yusufyildirim picture yusufyildirim  路  53Comments