Reputation: 40934
I followed the official guide on adding React Native to existing iOS apps (Swift).
pod install
finished successfully and I got to the point when I import React
in a Swift file and try to compile the app.
The build fails with an error in the yoga
dependency. Xcode cannot find the C++ standard library:
However, then I click "Go to definition" on <algorithm>
, Xcode can find it:
These are my project settings (I tried a few different combinations):
I'm fairly new to iOS development, so this might be a simple issue with our existing project, Xcode, Command Line Tools, or my machine. I Googled around a bit, no luck so far.
Any help from someone familiar with iOS development is appreciated! When we find the solution I'd like to update the official guide so others don't get stuck adding React Native to their app.
Upvotes: 1
Views: 493
Reputation: 21048
I believe your issue is fixed by this PR https://github.com/facebook/react-native/pull/17764, which reduces the number of exported Yoga headers to those that are actually needed to be able to build and as part of that removes headers that require C++ and its stdlib.
Upvotes: 1