Today I am going to share the solution to the common error that most of the React Native developers are facing. This error occurs when we run React Native App in IOS or Archive App using Xcode. Its a glog error saying config.h file not found mutex.h. The Screenshot of the error in the following.
Solution: “config.h file not found mutex.h Error”
This error happens when glog is not configured properly in your React Native Project. To solve this error follow the steps below.
First better to remove node_modules Directory & clean cache. For that run the following commands one by one in your main React Native project directory.
$ rm -rf node_modules/ $ yarn cache clean $ yarn install
Now we need to run “ios-install-third-party.sh” script that is present inside “node_modules/react-native/scripts/” directory. For that run the following command.
The above command will create a folder named “third-party” inside “node_modules/react-native/” directory. Now we need to navigate the third-party/glog directory and configure glog. For that run the following commands.
The above command can vary, depending upon your installed glog version. It can be “glog-0.3.5” or “glog-0.3.4”. You can check the exact directory name of the glog directory in your finder.
Now after navigating to the glog directory in your terminal run the following commands one by one.
$ ./configure $ make $ make install
That’s it. Now you can open your project in Xcode, Clean and rebuild it. It should not show “config.h file not found mutex.h” error again.