How to solve "config.h file not found"? when you start the application from responding native on the device?

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

I run the application on the device from the xcode project.

I have google and found many solutions, but I did not work, I tried this

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

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

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 problem. Thanks

+5
source share
4 answers

try

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 configure script:. / configure enter image description here Open Xcode and try to run the application.

+5
source

I ran into the same problem and fixed these commands: -

yarn

 rm -rf node_modules/ yarn clean cache yarn install 

NPM

 rm -rf node_modules/ npm cache clean npm i 
+3
source

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 terminal, go to react-native/third-party/glog folder inside node_modules

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

Once active 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

+1
source

Just go to the config.h file, click on the right panel and add the file to the application, checking the correct case. Clean and compile again.

0
source

Source: https://habr.com/ru/post/1269795/


All Articles