-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
I am logging this as a bug as it seems like a bunch of people have logged it as an issue on Stackoverflow ... but seems to be a bug http://stackoverflow.com/questions/41505616/yoga-yoga-h-header-file-not-found-after-react-native-integration-in-the-existing
Upgraded to latest react-native 0.4.0
Build project for iOS on Xcode and you get the error message: /Users/adamginsburg/Documents/development/buzzy9/node_modules/react-native/React/Base/RCTConvert.h:13:9: 'yoga/Yoga.h' file not found
- React Native version: 0.4.0
- Platform: iOS
- Operating System: The build issue happen on XCode 8
julienfouilhe, wildseansy, mmckinley8, bitcoinvsalts, MarkMolina and 40 more
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
adamgins commentedon Jan 9, 2017
Is this the reason? https://github.com/facebook/react-native/releases/tag/v0.40.0
fgaleano commentedon Jan 9, 2017
I'm getting similar error messages. In my case:
I had like 5-6 more but those went away after I deleted my
node_modules
folders and rannpm install
. These 2 remained, though, and my app won't build.What are we missing?
julienfouilhe commentedon Jan 10, 2017
I am using react native in an already existing iOS app. Everything is working fine with
0.39.0
.When I tried updating to 0.40.0, I get this error message when compiling (RCTConvert.h yoga/Yoga.h file not found)
@emilsjolander
emilsjolander commentedon Jan 10, 2017
Seems like the xcode project needs to be fixed in some way. Not really sure what could have broken this. @mmmulani Could you have a look?
JesseARWhite commentedon Jan 10, 2017
This looks like it has something to do with Cocoapods integration, @julienfouilhe @emilsjolander can you confirm if this is coming from cocoapods or not?
julienfouilhe commentedon Jan 10, 2017
@JesseARWhite I am using CocoaPods yes, but I don't know if it is responsible for the error or not. XCode is giving the error when trying to build the app.
robhogan commentedon Jan 10, 2017
I think this is the same issue we had in #9544, and occurs whenever
use_frameworks
is enabled - essentially a framework can't include its own internal headers using angle brackets.Because FB needed to use angle brackets for its internal builds of CSS Layout @alloy proposed a compromise which was removed in 7c91f89 . Since the move to using angle brackets everywhere, the use of RN as a framework now looks pretty much beyond repair.
AFAIK it's still possible even in a swift project to disable
use_frameworks
and import RN via a bridging header. It should also be possible to find+replace imports inpost_install
, but that's really only a brittle hack if RN has dropped support for frameworks.julienfouilhe commentedon Jan 10, 2017
@rh389 I'm using swift and not using
use_frameworks!
would be painful, wouldn't it? Some of my dependencies are written in Swift.What would need to be done in a post_install script? Changing
<yoga/Yoga.h>
for"yoga/Yoga.h"
did not help, even when I added:${SRCROOT}/../ios-editor/node_modules/react-native/ReactCommon
to the User Header Search Paths of my projectmmmulani commentedon Jan 10, 2017
cc @javache can you reapply for fix for the include header to yoga now?
mmmulani commentedon Jan 10, 2017
hey everyone, I tried to repro this issue by creating a tiny project and following the Obj-C guide here: https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
but I was not able to run into the Yoga build problem.
does anyone have a smaller repro case they could post?
robhogan commentedon Jan 10, 2017
I'll see if I can post a repro case tomorrow, I did reproduce the issue earlier - in the meantime have you tried enabling
use_frameworks
, even in Objective-C? I haven't yet been able to get that working as a minimal build in a new app at all without modifying RN.Edit: (Back at the mac) - repro case now up
That was created simply by creating a new single-page ObjC app with the XCode wizard, then
yarn add react-native react
, adding aPodfile
as in the repo, andpod install
.Attempting to build that in XCode should allow you to reproduce the
yoga/Yoga.h
not found immediate issue. It is possible to add[...]/ReactCommon
recursive to the project's header search paths in order forYoga.h
to be found, but then the issue is eg#import <yoga/Yoga.h>: RCTConvert.h:13:9: Include of non-modular header inside framework module 'React.RCTConvert'
- that's the more fundamental problem once you've got beyond search paths - as discussed in #9544 (and as far as I understand it - no expert) framework modules can have dependencies on their own internal headers or on other framework modules, but not on arbitrary, potentially external libraries.I don't know of a way to overcome this while the
#import
style is what it is across RN.julienfouilhe commentedon Jan 11, 2017
Hi @mmmulani I also created a simple swift project, with all the files already in the repo, so all you have to do is launch the xcworkspace in xcode and try to build: https://github.com/julienfouilhe/test-yoga-file-not-found
Thanks!
What is weird too is the directories architecture:

mmmulani commentedon Jan 19, 2017
@javache and I found a workaround to this problem and we'd like someone from the community to champion it and support it going forward.
we created a
yoga.podspec
atnode_modules/react-native/ReactCommon/yoga
with contents:and then include it from the main Podfile with
pod 'yoga', :path => './node_modules/react-native/ReactCommon/yoga'
you would have to make another one for jschelpers and possibly any other subspec we have that uses a different header search path.
but this seems like a bug in CocoaPods, it should let use create the React dependency and link all its subspecs statically but create the whole React dependency as a dylib. cc @alloy for any ideas here
Aleksandern commentedon Jan 20, 2017
@mmmulani
It looks like it doesn't work in my case
I still have have an error
Podfile
But I had to change
pod 'yoga', :path => './node_modules/react-native/ReactCommon/yoga'
topod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
83 remaining items
Make podspec great again.
gotoAndBliss commentedon May 19, 2017
This error occurs again on a fresh install of
react-native: 0.44.0
quantuminformation commentedon May 19, 2017
@gotoAndBliss try deleting your ios build folder
cliren commentedon Jun 12, 2017
I am running into the following error and have setup a simple example for anyone to advise what's going wrong here: https://github.com/cliren/RNIntegration.
Using cocopods version: 1.1.1 (can't upgrade due to exiting app's dependency). Appreciate any help!
tmaly1980 commentedon Jun 13, 2017
I had a similar issue with yoga/Yoga.c, and fixed it by running
react-native link
cliren commentedon Jun 13, 2017
@tmaly1980 I tried your suggestion on https://github.com/cliren/RNIntegration but still ran into the same issue. I am using the below dependencies, may I know what versions are you using?
tmaly1980 commentedon Jun 13, 2017
cliren commentedon Jun 14, 2017
@tmaly1980 I tried 0.42.3 and 15.4.1 but still get the same error. It looks very fragile unless I am missing something basic. Would you mind checking if I am missing anything here: https://github.com/cliren/RNIntegration?
tmaly1980 commentedon Jun 14, 2017
samthui commentedon Sep 11, 2017
After upgrading from RN 0.42.3 to 0.43.3, I got similar issue with RCTDevMenu, though I'm sure these file exist.
My project also uses CocoaPods for iOS project. After re-running
pod install
and restart MAC, it works normally.I noticed that in terminal console of
pod install
, it logged:(Thanks to that I know that CocoaPods need to re-config RN dependency by running
pod install
, previously I thought that CocoaPods only needs to be configured once and use path to its dependencies all afterwards.)brenordr commentedon Oct 21, 2017
For the ones having this issue with RN 0.47 or above,
I've discovered that it appear in a project I'm working after change the disk to case sensitive.
CocoaPods seems name the Yoga project as <Yoga/Yoga.h> not <yoga/Yoga.h>
Revert the disk fixed (at least locally) the issue.
React/RCTBridgeModule.h
file not found when following set up instructions using ExpoKit dotintent/react-native-ble-plx#221