Reputation: 2626
In X-Code project of react native, getting error
config.h file not found.
Here is version detail :
react-native-cli: 2.0.1
react-native: 0.51.0
How to solve it?
Upvotes: 32
Views: 22842
Reputation: 5271
Although the already mentioned answers are correct but still few guys are struggling, as only configuring the glog doesn't sometimes resolve the error. Here I have written a detailed solution to the problem.
Solution: config.h file not found mutex.h During Archive.
The steps are the following:
For all these above steps the I have shared commands in the above mentioned article, so not going to write again. I hope it will solve problem for guys who are still struggling.
Upvotes: 0
Reputation: 123
If everyone has tried solving the issue by this Open Terminal, go to your project's root folder and run: cd node_modules/react-native/third-party/glog-0.3.4/ Run the configure script: ./configure
But still not got the solution then,
Go to your Xcode and check if there any library is missing. Add that library and then perform this above step.
Upvotes: 0
Reputation: 955
This is the linking issue in xcode. You just need to re-link the files. Please follow the below steps:
If after running the project you are getting linking issue then please make sure you have added all the (ios) products () come under the Libraries -> React.xcodeproj -> Products in your Build Phases -> Link Binary With Libraries.
Upvotes: 0
Reputation: 21
If above all answers don't work,
Please check that there is no space
in any directory name of the full path and not only the project directory name.
While in terminal, it accepts throgh My Disk
as My\ Disk
but xcode do not recognize that.
If its in My Disk directory, try after moving it to Desktop or any other directory which doesn't have space in their name.
Upvotes: 2
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
It works for me, I hope it helps for you.
Upvotes: 3
Reputation: 797
configure: error: unsafe absolute working directory name Issue:
-Open Terminal, go to your project's root folder and run:
./configure
got error: configure: error: unsafe absolute working directory name
try to created app in desktop and from there run ./configure command.
Please note with XCOXE 10, and Mojave MAC OS , I had same issue, ./configure was showing some permission issue, I had set permission "777" to project folder enclosing with inner folders
Upvotes: 0
Reputation: 921
Close Xcode.
Open Terminal, go to your project's root folder and run:
cd node_modules/react-native/third-party/glog-0.3.4/
Run the configure script:
./configure
Open Xcode and try to run your app.
Upvotes: 91
Reputation: 1628
These steps worked for me:
rm -rf ~/.rncache
rm -rf node_modules/
npm install
npm start
Upvotes: 3
Reputation: 2380
I had the same issue, using this steps solves for me:
Running into the same issue here after upgrading from 0.44. None of the above solutions or clearing caches did the trick for me. Here's what I did to get things working again:
react-native/third-party/glog
folder inside node_modules (for me, this was cd node_modules/react-native/third-party/glog-0.3.4
)sh ../../scripts/ios-configure-glog.sh
Glog is configured and the required config.h header file is created for Xcode to findRegards!
Upvotes: 12
Reputation: 1867
When project files get messed up for me. I typically follow these steps.
rm -rf node_modules
npm install
react-native upgrade (Only changing affected files, so IOS for you)
react-native link
npm start --reset-cache
(In another terminal)
react-native run-ios
Upvotes: 6