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:
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.
- New react-native app has 'TypeError: babelHelpers.typeof is not a function'
- How can I regenerate ios folder in React Native project?
- How to build and deploy a react-native app from command line?
- Silent iOS Push Notification with React Native when app is in background
- React Native: How to select the next TextInput after pressing the “next” keyboard button?
- react-native-linkedin-sdk - Cannot read property 'configure' of undefined (LinkedInSessionManager.ios.js)
5 Solutions Collect From Internet About “React Native / Xcode Upgrade and now RCTConvert.h not found”
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
To solve the issue, you have to do the following:
- In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).
- Click on the ‘Build’ option at the left pane.
- Uncheck ‘Parallelize Build’ under Build Options.
- Then in Targets section, click ‘+‘ button then search for ‘React’. Select it and click ‘Add‘.
- ‘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).
- 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.
In react-native 0.40
you have to replace
#import "RCTBridgeModule.h" with
then clean and build it again.
There is a breaking change on 0.40, you can see details here.
Quoting directly from the release notes:
This means that all iOS native libraries need a major version bump
for RN 0.40. We attempt to minimize changes of this magnitude, and we
apologize for any inconvenience caused.
So, all native iOS libraries will need an update before getting compatible with react-native version 0.40.
If your app isn’t to large, just
1) rename original app 2) create the same app again react-native init <orig_app_name> 3) copy over all necessary files from your original app to the newly created one 4) adjust the package.json 5) npm install 6) react-native run-<ios|android>
I spent hours to find, where to link the new libraries, it was at least a valuable option and shortcut for me.
hope it helps somebody
Here is how I made it work:
- I cleaned my package.json to the latest version,
- I did the trick by @max23_
- I replaced all the
#import '....h'that were causing error to the corresponding
- How do I place a slider value in label?
- Reading in a JSON File Using Swift
- UICollectionView Flow layout no fixed row height
- Persistence Through Segues
- App with jailbreak detection rejected by Apple
- How can I better optimize networking on iOS?
- How can I deliver an iOS app IPA to a customer to be signed with their own Enterprise provisioning profile
- Xcode – How to change application/project name : what do I need to to update and check?
- Are all weak references nilled if we enable zombie object?
- Xcode 6.3.2 or 6.4beta Localization failed to read a strings file
- UITableView reload data
- How to show “Copy” menu for a table cell?
- UIGestureRecognizer receive touch but forward it to UIControl as well
- Xcode – How to share the app in development with clients?
- Pod file not being initialized?