Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "config.h file not found"? when running app from the react native on the device?

Getting error "Config.h file not found, lexical or preprocessor error."

I am running app in the device from the xcode project.

I have google and found many solutions but haven't worked, I tried this

https://github.com/facebook/react-native/issues/14382

And when I try to run in the iOS simulator getting this error

https://github.com/facebook/react-native/issues/10401

Tried to follow the above url but didn't work.

Please let me know how to solve the issue. Thanks

like image 739
Gopal Devra Avatar asked Jul 13 '17 13:07

Gopal Devra


3 Answers

try it

Open Terminal, go to your project’s root folder and do:
cd node_modules/react-native/third-party/glog-0.3.4/

enter image description here Run the configure script: ./configure enter image description here Open Xcode and try to run your app.

Xcode 10

"react-native": "0.57.5"

cd ./node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd $(ls | grep 'glog' | awk '{print $1}') && ./configure
like image 181
Vishal Vaghasiya Avatar answered Nov 14 '22 15:11

Vishal Vaghasiya


I faced the same issue and it's fixed by these commands:-

yarn

rm -rf node_modules/
yarn cache clean
yarn install 

npm

rm -rf node_modules/
npm cache clean  
npm i 
like image 4
Ahmed farag mostafa Avatar answered Nov 14 '22 13:11

Ahmed farag mostafa


For me:

# rm -rf  node_modules

# npm cache verify  (Because I'm using npm version 5.0.3)

# npm install

Xcode Clean

Xcode Run

If that doesn't work,

In the Terminal, navigate to the react-native/third-party/glog folder inside node_modules

(for me, this was cd node_modules/react-native/third-party/glog-0.3.4)

Once actively in this folder,

#run ../../scripts/ios-configure-glog.sh

Glog is configured and the required config.h header file is created for Xcode to find

like image 3
Mohamed Elmi Hassan Avatar answered Nov 14 '22 15:11

Mohamed Elmi Hassan