question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xcode build fails when importing React after fresh integration

See original GitHub issue

Followed 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.

screen shot 2018-03-05 at 3 52 43 pm

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

  • yarn add react-native
  • Address #17764 with yoga.podspec changes: spec.public_header_files = 'yoga/Yoga.h', 'yoga/YGEnums.h', 'yoga/YGMacros.h'
  • pod install
  • Address #16039 by changing import to <React/fishhook.h>
  • Build successfully
  • import React
  • Build error

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

2reactions
Plo4oxcommented, Mar 10, 2018

@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 doing CGSize &minimumSize, which is working in ObjC++ but not in Objc, instead of CGSize * 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 😃

0reactions
react-native-botcommented, May 15, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found