Anjana
Anjana

Reputation: 779

"config.h" file not found react native iOS

I tried almost all the solutions given to resolve this issue but nothing is working for me.

This issue is occurring when I am opening .xcodeproj

Can anyone please provide a permanent solution for this?

Upvotes: 1

Views: 3049

Answers (3)

Hussain Thajutheen
Hussain Thajutheen

Reputation: 441

This issue is caused by Xcode's recent update. I fixed this issue by the following easy steps and I found this to be the best solution after searching for a while and tried many.

  1. Go to Xcode > File > Project Settings
  2. Build System > Select "Legacy Build System"
  3. Go to terminal and run cd /to-your-project-folder
  4. Run rm -rf node_modules && yarn (to remove node_modules and reinstall them)
  5. Go back to Xcode > Product > Clean
  6. Product > press option key and then click Clean Build Folder
  7. And click the clean button

Now you can run the project from Xcode or on the terminal run yarn run ios or react-native run-ios

Credits to Spencer Carli's video on YouTube

I hope this helps :-)

Upvotes: 1

Minhaj Javed
Minhaj Javed

Reputation: 981

You need to change to the legacy build system in Xcode 10 and install third party scripts manually.

  1. File > Project/Workspace settings
    Build System: dropdown > change to Legacy Build system

  2. Follow this to manually install third party scripts for RN:

Clean RN cache

$ rm -rf ~/.rncache

Re-install the deps

$ cd your_project_path
$ rm -rf node_modules/ && npm install

Then install the third-party

$ cd node_modules/react-native/scripts
$ ./ios-install-third-party.sh

Run the commands below if glog installation failed.

$ cd ../third-party/glog-0.3.x
$ ./configure

Upvotes: 1

Lijith Vipin
Lijith Vipin

Reputation: 1906

1) Close your Xcode.

2) Open Terminal, go to your project's root folder and do:

cd node_modules/react-native/third-party/glog-0.3.4/

3) Run the configure script:

./configure

4) Open Xcode and try to run your app.

Upvotes: 2

Related Questions