Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mojave + Xcode 10 build fails on glog config.h, gflags/gflags.h

I'm testing React Native 0.56.0-rc.2 on Mac OS Mojave and Xcode 10.

Running:

react-native init TestProject --version="0.56.0-rc.2"
cd TestProject
npm run start
react-native run-ios

Which generated some long errors.

Entering Xcode gave me a failure on missing config.h for glog, which I found could be built manually:

cd ./node_modules/react-native/third-party/glog-0.3.4
./configure && make && make install

Which passed that stage, but got me on yet another issue

(...)/node_modules/react-native/third-party/glog-0.3.4/src/glog/logging.h:85:10:
'gflags/gflags.h' file not found

I can't find anything related to RN and this on Google or Stack Overflow, only references to other packages and instructions to install those on a Debian-based system.

Is this a known issue?

like image 804
Wes Souza Avatar asked Jun 17 '18 12:06

Wes Souza


4 Answers

Running this from the project directory fixed it for me:

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

This manually triggers the config script

like image 97
NM Pennypacker Avatar answered Nov 16 '22 06:11

NM Pennypacker


A simple and quick resolution. In Xcode, go to File->Project/Workspace settings. Change the build system to Legacy Build system.

This is the resolution from Wesley's link. Saw something the other day about posting the direct answer and trying to avoid linking because links / websites can change. I was going to leave this as a comment, but don't have enough rep.

like image 29
Andy G. Avatar answered Nov 16 '22 06:11

Andy G.


Update

It is a known issue, tracked here:

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

like image 2
Wes Souza Avatar answered Nov 16 '22 08:11

Wes Souza


I resolved it by running following steps

  • In the root of the project, run 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
like image 1
Vittal Pai Avatar answered Nov 16 '22 07:11

Vittal Pai