Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
604 views
in Technique[技术] by (71.8m points)

reactjs - React Native / Xcode Upgrade and now RCTConvert.h not found

App ran fine on React Native 0.35.0. After updating to 0.40.0 via react-native-git-upgrade I get a number of lexical/preprocessor issues when trying to build/run the app in XCode.

React/RCTBridgeModule.h' file not found

When clicking on the issue I see this highlighted:

#import <React/RCTBridgeModule.h>

It doesn't appear to be a search path issue.

I've tried deleting node_modules and running npm install again, but that hasn't fixed anything.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As pointed out by th0th, there is a breaking change in RN 0.40 for iOS. In short, RN header declarations are updated to point to the include path $(BUILT_PRODUCTS_DIR)/include/React.

To solve the issue, you have to do the following:

  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.

Note: You might still have similar header issue with other libraries (e.g. react-native-fbsdk) that are referring to those react native .h files.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...