Xcode build fails when importing React after fresh integration
See original GitHub issueFollowed the Integrate with Existing Apps guide.
After dealing with issues #17764 & #16039, the project finally compiled with no errors. Then, simply import React
in a swift source file and building results in the following error.

Environment
Environment: OS: macOS High Sierra 10.13.2 Node: 9.7.1 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found
Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.1 react-native: ^0.54.0 => 0.54.0
Expected Behavior
No build errors when importing React
Actual Behavior
Build error on importing React
Steps to Reproduce
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:7
Top Results From Across the Web
App Won't Compile with Embedded Third Party Framework
So, I'm getting this error when trying to run the app. "Build succeeds" but the app won't run and Xcode spits out an...
Read more >No such module 'React' - Integrating React Native into existing ...
I'm trying to add React Native into an existing iOS app developed in Swift ... when I try to "import React" it gives...
Read more >React Native Navigation: Tutorial with examples
In this React Native Navigation tutorial, we'll show you some examples of navigation patterns you can implement with React Navigation.
Read more >Installation in React Native and bare projects
For certain type of errors, you can provide more helpful error messages. To turn this on, import import expo-dev-client in the project's index...
Read more >Common iOS issues - Codemagic Docs
Solution: This error occurs on M1 machines when the xcode property is not set to version 13.x. Please configure your workflow to use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@carrchr It is cool if it still work in 0.53.3 (I didn’t took the time to re-test it ^^) but as I said in my issue, It is always better to be able to have the latest version of a framework with its latest features 😃 @steven-diaz Thanks for reporting the issue. After reproducing your issue, I really think that React-Native developers seem to use obj-C++ but that is not the right thing to do if they want iOS developer to be able to use their framework easily. As Apple say here:
You cannot import C++ code directly into Swift. Instead, create an Objective-C or C wrapper for C++ code.
and in your case it is what happens. They are passing references by doingCGSize &minimumSize
, which is working in ObjC++ but not in Objc, instead ofCGSize * minimumSize
I don’t know what to do. I don’t think that creating a huge patch is the best solution but, well that’s what I’m doing for now 😃Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?
Thank you for your contributions.