ios Mobile React Native

React Native React/RCT*.h not found (1)

React Native is always painful to use 3rd party libraries with native code.
One of the issues we often face is React/RCT*.h file not found.

Specific case we are going to inspect today is when using outdated 3rdparty package which is not providing autolinking.

Projects for iOS that does not provides autolinking means the project does not have podspec file.

In this case, if the iOS XCode project used React/RCT*.h header file, it will spit out the file not found error.

There are 2 solutions:

  • Suggest / Ask plugin maintainer to add podspec file and update the plugin. (We have to wait and no one knows when he/she will do).
  • Manually add header search path in the XCode project.

First solution is just throw ball to original guy, needs to wait.
But what if the project is urgent and can not wait?

In order to manually add header search path, First make sure you manually called link command: npx react-native link PACKAGE_NAME

This will add the project as library to the XCode workspace and can be found under Libraries.

Select all the plugin projects, Go to “Build Settings” / “Search Paths” / “Header Search Paths”

Then add “$(SRCROOT)/../../../ios/Pods/Headers/Public”

(Exact number of ../ will vary per project and libraries, so make sure you give correct path).

Then you will see all those chains of file not found will be fixed at once.

Stan

Stan is an experienced full-stack developer and software engineer who is focused on web and game development. He is enthusiastic about new technologies. Stan is highly skilled in many programming languages and frameworks, and he always tries to deliver the best approach.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *