react-native: 'config.h' file not found

Environment

Environment: OS: macOS High Sierra 10.13.3 Node: 8.6.0 Yarn: 1.2.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.4 => 0.55.4

Description

when i adding a single view to existing native applications, it works ok. But an error occurred when I tried to package my app.

Steps to Reproduce

Successfully integrated into existing applications package error

Expected Behavior

package success

Actual Behavior

…/ios/Pods/glog/src/base/mutex.h:105:10: fatal error:

  'config.h' file not found

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 35 (2 by maintainers)

Most upvoted comments

Please use Stack Overflow for this type of question.

I need a little bit more, but then it works for me too 😃

rm -rf node_modules/ && yarn cache clean && yarn install
node_modules/react-native/scripts/ios-install-third-party.sh
cd node_modules/react-native/third-party/glog-0.3.4
./configure

(replace glog-0.3.X with yours)

bildschirmfoto 2018-09-24 um 09 47 51 replace with `NULL` bildschirmfoto 2018-09-24 um 09 48 06 bildschirmfoto 2018-09-24 um 09 50 59

Remove library libfishhook.a and add again bildschirmfoto 2018-09-24 um 09 52 00 bildschirmfoto 2018-09-24 um 09 52 13

I wrote something a bit cleaner for my purposes and installed the fix within the node_modules/react-native package. Normally I would prefer not to modify a node_module directly, but under this circumsance I felt that it was worth it and allowed us to add a simple script in our yarn start script and we get a clean run from a fresh clone in multiple products.

“react-native-vector-icons”: “4.5.0” this script can be useful for a bug relating to this package. rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json

glog-0.3.4

Xcode 9.2: “react”: “15.4.1” / “react-native”: “0.38.1” Xcode 9.4.1: “react”: “16.0.0-alpha.12” / “react-native”: “0.53.0”

cd node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd glog-0.3.4 && ./configure && cd ../../../../

glog-0.3.5

Xcode 9.4.1: react": “16.5.0” / “react-native”: “0.57.1” / “metro-react-native-babel-preset”: “0.47.0” Xcode 10: react": “16.5.0” / “react-native”: “0.57.1” / “metro-react-native-babel-preset”: “0.47.0”

cd node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd glog-0.3.5 && ./configure && cd ../../../../

manual npm install or yarn - install packages cd node_modules/react-native - go to node modules directory scripts/ios-install-third-party.sh- install @ node_modules/react-native/third-party cd third-party - go to newly created third party directory cd glog-0.3.x - ls -la to find your directory version number or just use tab to auto-complete ./configure - run setup cd ../../../../- change back to your project directory react-native run-ios or react-native run-android - deploy

Fix my bug.

rm -rf node_modules/ && yarn cache clean && yarn install node_modules/react-native/scripts/ios-install-third-party.sh

For any glog

cd ./node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd $(ls | grep 'glog' | awk '{print $1}') && ./configure

@ReggaePanda I did indeed have to run that /configure script but I had to run it within the glog directory, aka cd node_modules/react-native/third-party/glog-0.3.4/; ./configure

This worked for me:

rm -rf node_modules/ && yarn cache clean && yarn install
node_modules/react-native/scripts/ios-install-third-party.sh
cd node_modules/react-native/third-party/glog-0.3.4
./configure

I’m always amazed - how do you guys figure out cryptic errors like those? Especially when it is what feels like an endless chain of fix/new error story…

Thanks for the fix @ReggaePanda .

thank you @ReggaePanda, it works, you helped me a lot!

I followed the pastures of @MinhajJaved … however after executing the command “./ios-install-third-party.sh”, I moved the “third-party” directory to a level below that is in the folder "node_modules / react-native “and I ran the next command” cd …/third-party/glog-0.3.xe ./configure "… it worked perfectly …

Why did I do this? because the command “ios-install-third-party.sh” installs the “third-party” package in the “node_modules / react-native / scripts” folder and not at a level below that would be "node_modules / react-native ".

This for react-native 0.57.7

tks @MinhajJaved

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.

This instructions works as long as theres no space in project’s path…

Same here. @ReggaePanda, thanks very much for sharing!

@ReggaePanda YOU’RE THE MAN. After spending a 10 hours trying to figure this out, your process finally worked. Can’t thank you enough!

I had an error pointing to a missing ./config file. Because the ios-install-third-party.sh uses relative paths.

Here’s my solution: cd ./node_modules/react-native/scripts/third-party/glog-0.3.4 && ../../scripts/ios-install-third-party.sh && cd ../../../../

Note the glog-0.3.4 version may change depending on your react-native version.

@ReggaePanda

Can’t thank you enough!

@ReggaePanda I did indeed have to run that /configure script but I had to run it within the glog directory, aka cd node_modules/react-native/third-party/glog-0.3.4/; ./configure

This answer works just fine. Thanks

i just remove spacing from project parent folder name

Working On to Working-On

Close Xcode --> Clean --> Run

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.

Why are none of these steps listed on the guide here? https://facebook.github.io/react-native/docs/running-on-device