LoginSignup
1
2

More than 5 years have passed since last update.

react-native iOSアプリのビルド時の'glog/logging.h' file not foundエラーを解消する

Last updated at Posted at 2019-03-02

エラー発生状況

下記の環境下でXcodeでiPhoneシミュレーターにビルドしようとしたところ、Xcode上で突然'glog/logging.h' file not foundが発生しました。
このエラー解消にかなり苦戦したのでその対処法を記載しておきます。レアケースかもしれませんが、誰かのお役に立てたら幸いです。

  • react-native: 0.52.0
  • Xcode: 10.1
  • Node.js: 8.10.0

対処方法

対処した過程を書いていくので、やや冗長かもしれませんがお許しを:pray:

まずは'glog/logging.h' file not foundでググると、StackOverflowで'glog/logging.h' file not foundというまさにという質問がヒット。
しかも解決済みっぽかったので早速以下を実行しようと試みると、、、

~> cd node_modules/react-native/third-party/glog-0.3.4                                                                                                                                │jest-haste-map: watch error:
cd: The directory 'node_modules/react-native/third-party/glog-0.3.4' does not exist      

なぜか対象のファイルがない、、、!
しかもよく調べてみるとthird-partyというディレクトリすら存在しない。
ということで、ひとまずrm -rf node_modules && yarn cache clean && yarn installしてみるも変わらず。

再度ググっていると、Developers - Xcode 10: third-party: 'config.h' file not foundという記事に良さげな解決策が。

Share the steps I solved:
1. rm -rf node_modules/ && yarn cache clean && yarn install and rm -rf ~/.rncache
2. cd node_modules/react-native/scripts
3. ./ios-install-third-party.sh If your network is slow, you can download the packages separately and move them to the rncache folder 1. folly-2016.10.31.00 2. double-conversion-1.1.5 3. glog-0.3.4 4. boost_1_63_0
4. cd <Your-Project-Folder>/node_modules/react-native/third-party/glog-0.3.4
5. ./configure
6. Xcode Clean & Build

この手順で実行しようと試みるも、またしてもthird-partyがない:scream:

途方にくれながらふとnode_modules/react-native/scripts配下を覗いてみると、なぜかここにthird-partyディレクトリを発見(なぜ?)

ということで以下を実行。

~> cd node_modules/react-native/scripts/third-party/glog-0.3.4
~> ./configure

するとなぜかnode_modules/react-native/third-partyが出来上がったので、以下を実行すると無事エラーが解消されました。

  1. cd <Your-Project-Folder>/node_modules/react-native/third-party/glog-0.3.4
  2. ./configure
  3. Xcode Clean & Build

※ 本当はこの後さらにerror: Build input file cannot be found: '/libfishhook.a'というエラーも出たのですが、これについては Xcode10アップデート後にreact-nativeのiOSビルドが通らなくなった人向けの記事で書いてくださった方法ですぐに解決しました。

結論、Xcode辛いです...

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2