react-native: 'glog/logging.h' file not found

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
      Memory: 6.74 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.13.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.58.0-rc.1 => 0.58.0-rc.1
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

I just tried to create a new project using react-native init --version=react-native@0.58.0-rc.1 for testings about this issue but i face this problem! I guess this is a regression!

Reproducible Demo

  1. react-native init MyTestingProject --version=react-native@0.58.0-rc.1
  2. cd MyTestingProject/ios
  3. open MyTestingProject.xcodeproj
  4. File / Project Settings… / Build System => Legacy Build System / Done
  5. Product / Clean
  6. Product / Clean Build Folder
  7. Build

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 24

Most upvoted comments

I fixed it by deleting the podlock file and doing a pod install, sharing here so that it might help someone

@artechventure I installed Xcode in Applications under XCode 10.1 directory (with space) and it broke compilation process. Renaming to XCode10.1 fixed the issue.

Well, i know this is a weird solution but it works!

I edited ../node_modules/react-native/scripts/ios-install-third-party.sh and deleted these lines:

fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc "\"$SCRIPTDIR/ios-configure-glog.sh\""
fetch_and_unpack double-conversion-1.1.6.tar.gz https://github.com/google/double-conversion/archive/v1.1.6.tar.gz 1c7d88afde3aaeb97bb652776c627b49e132e8e0
fetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz c3f57e1d22a995e608983effbb752b54b6eab741
fetch_and_unpack folly-2016.10.31.00.tar.gz https://github.com/facebook/folly/archive/v2016.10.31.00.tar.gz fb8cdf8962d8c9d0c20a150b6ec3b75d1fa50696

then i copied the whole third-party folder from another project which is "react-native": "0.57.7" and its working!

Please consider that i ran ./configure and make in the project of "react-native": "0.57.7" too!

I guess there’s a problem in the GitHub files!

@hramos (BTW, Happy New Year 😁 🎉 )

Did you try the ole rm -rf ~/.rncache node_modules/react-native/third-party/*?

Well, i know this is a weird solution but it works!

I edited ../node_modules/react-native/scripts/ios-install-third-party.sh and deleted these lines:

fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc "\"$SCRIPTDIR/ios-configure-glog.sh\""
fetch_and_unpack double-conversion-1.1.6.tar.gz https://github.com/google/double-conversion/archive/v1.1.6.tar.gz 1c7d88afde3aaeb97bb652776c627b49e132e8e0
fetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz c3f57e1d22a995e608983effbb752b54b6eab741
fetch_and_unpack folly-2016.10.31.00.tar.gz https://github.com/facebook/folly/archive/v2016.10.31.00.tar.gz fb8cdf8962d8c9d0c20a150b6ec3b75d1fa50696

then i copied the whole third-party folder from another project which is "react-native": "0.57.7" and its working!

Please consider that i ran ./configure and make in the project of "react-native": "0.57.7" too!

I guess there’s a problem in the GitHub files!

@hramos (BTW, Happy New Year 😁 🎉 )

You saved my day!!! Thanks

@MohamadKh75 Using Xcode 10.1 and experiencing this.

fix here https://github.com/facebook/react-native/pull/26300

if you get ‘glog/logging.h’ the third party libraries are failing to install. the podspec script launcher is not throwing any error.

if you are on appcenter you need to update the pods on pre-build https://gist.github.com/thisisablock/b57185cc3657d4e0252960a0bd7cf0a9

Same issue happened to me after cancelling build in xcode and running it again (xcode v10.2.1, rn 0.59.10). I used Product->Clean Build Folder and puff, it fixed the problem.

@KushalDesai1 I’ve also encountered this issue and could not get any of the proposed solutions to work. However, I did find one that did. I copied ios-configure-glog.sh from the react-native@0.57.7 project to my current project react-native@0.59. It turns out that in my case it wasn’t a corrupted install of glog or double-conversion. The issue was with the following code in the script:

# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"

Try removing that if it exists in your current project. Hopefully that works for you.

I’d prefer to have some repro steps before reopening.

thanks for reporting, I feel that we can close this then.

I can confirm this issue is resolved in Xcode 10.1 but exist in Xcode 10