New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 10: third-party: 'config.h' file not found #14382

Closed
joncursi opened this Issue Jun 8, 2017 · 134 comments

Comments

Projects
None yet
@joncursi
Contributor

joncursi commented Jun 8, 2017

After upgrading from 0.44.3 -> 0.45.0, XCode no longer builds for me with the following error:

Lexical or Preprocessor Issue
'config.h' file not found

screen shot 2017-06-08 at 2 14 56 am

I am not using cocoa pods, just npm packages. Seems like some related changes have been made that may be causing this issue?

@Tom-Bonnike

This comment has been minimized.

Tom-Bonnike commented Jun 8, 2017

I’ve got the same issue. :(

@javache

This comment has been minimized.

Member

javache commented Jun 8, 2017

Can you try removing the third-party folder in your node_modules/react-native folder?

@javache

This comment has been minimized.

Member

javache commented Jun 8, 2017

Looks like there's a bug with the install-third-party scripts. In ios-install-third-party.sh can you replace "$SCRIPTDIR/ios-configure-glog.sh" with "../../scripts/ios-configure-glog.sh"?

@Tom-Bonnike

This comment has been minimized.

Tom-Bonnike commented Jun 8, 2017

Removing the third party folder did the trick. (I left the third-party-podspecs folder, though). Do you still want me to try the other fix?

@javache

This comment has been minimized.

Member

javache commented Jun 8, 2017

Yeah, if you could try removing the folder again, and try if running that script still works, that'd be awesome!

@javache

This comment has been minimized.

Member

javache commented Jun 8, 2017

Sorry, I meant the react-native folder.

@Tom-Bonnike

This comment has been minimized.

Tom-Bonnike commented Jun 9, 2017

@javache
It did work (WITHOUT modifying the script like you asked), so yeah, can’t really reproduce the issue ☹️
Here’s the output just in case it could be of any help:

Unpacking /Users/tommy/.rncache/glog-0.3.4.tar.gz...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/Users/tommy/desktop/projets/suw-app/node_modules/react-native/third-party/glog-0.3.4/missing: Unknown `--is-lightweight' option
Try `/Users/tommy/desktop/projets/suw-app/node_modules/react-native/third-party/glog-0.3.4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh accepts -g... yes
checking for /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh option to accept ISO C89... none needed
checking whether /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh... gcc3
checking how to run the C preprocessor... /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh -E
checking whether we are using the GNU C++ compiler... yes
checking whether /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh accepts -g... yes
checking dependency style of /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh... gcc3
checking build system type... i386-apple-darwin16.5.0
checking host system type... arm-apple-darwin
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-apple-darwin-dumpbin... no
checking for arm-apple-darwin-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i386-apple-darwin16.5.0 file names to arm-apple-darwin format... func_convert_file_noop
checking how to convert i386-apple-darwin16.5.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for arm-apple-darwin-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-apple-darwin-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-apple-darwin-ar... no
checking for ar... ar
checking for archiver @FILE support... no
checking for arm-apple-darwin-strip... strip
checking for arm-apple-darwin-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh object... ok
checking for sysroot... no
checking for arm-apple-darwin-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for arm-apple-darwin-dsymutil... no
checking for dsymutil... dsymutil
checking for arm-apple-darwin-nmedit... no
checking for nmedit... nmedit
checking for arm-apple-darwin-lipo... no
checking for lipo... lipo
checking for arm-apple-darwin-otool... no
checking for otool... otool
checking for arm-apple-darwin-otool64... no
checking for otool64... no
checking for -single_module linker flag... + exec /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -g -O2 -o libconftest.dylib -dynamiclib -Wl,-single_module conftest.c
no
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... + exec /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -g -O2 -o conftest conftest.c -Wl,-force_load,./libconftest.a
no
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh supports -fno-rtti -fno-exceptions... yes
checking for /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh option to produce PIC... -fno-common -DPIC
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh PIC flag -fno-common -DPIC works... yes
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh static flag -static works... no
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh supports -c -o file.o... yes
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh supports -c -o file.o... (cached) yes
checking whether the /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... ++ xcrun -find -sdk iphoneos cc
++ xcrun -sdk iphoneos --show-sdk-path
+ exec /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -print-search-dirs
darwin dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh -E
checking for ld used by /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh option to produce PIC... -fno-common -DPIC
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh PIC flag -fno-common -DPIC works... yes
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh static flag -static works... no
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh supports -c -o file.o... yes
checking if /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh supports -c -o file.o... (cached) yes
checking whether the /Users/tommy/desktop/projets/suw-app/node_modules/react-native/./ios-cc.sh linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin dyld
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) no
checking for stdint.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking syscall.h usability... no
checking syscall.h presence... no
checking for syscall.h... no
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking libunwind.h usability... yes
checking libunwind.h presence... yes
checking for libunwind.h... yes
checking ucontext.h usability... no
checking ucontext.h presence... no
checking for ucontext.h... no
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking size of void *... 4
checking for uint16_t... yes
checking for u_int16_t... yes
checking for __uint16... no
checking for sigaltstack... yes
checking for sigaction... yes
checking for dladdr... yes
checking for fcntl... yes
checking for pread... yes
checking for pwrite... yes
checking for __attribute__... yes
checking for __builtin_expect... yes
checking for __sync_val_compare_and_swap... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking whether to check for GCC pthread/shared inconsistencies... no
checking for pthread_self in -lpthread... yes
checking for main in -lgflags... no
checking for gtest-config... no
checking for main in -lgtest... no
checking for backtrace in -lunwind... no
checking support for pthread_rwlock_* functions... yes
checking whether the compiler implements namespaces... yes
checking what namespace STL code is in... std
checking whether compiler supports using ::operator<<... 1
checking for ucontext.h... (cached) no
checking sys/ucontext.h usability... yes
checking sys/ucontext.h presence... yes
checking for sys/ucontext.h... yes
checking how to access the program counter from a struct ucontext... configure: WARNING: Could not find the PC.  Will not output failed addresses...
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/glog/logging.h
config.status: creating src/glog/raw_logging.h
config.status: creating src/glog/vlog_is_on.h
config.status: creating src/glog/stl_logging.h
config.status: creating libglog.pc
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Unpacking /Users/tommy/.rncache/double-conversion-1.1.5.tar.gz...
Unpacking /Users/tommy/.rncache/boost_1_63_0.tar.gz...
Unpacking /Users/tommy/.rncache/folly-2016.09.26.00.tar.gz...
@kumarryogeshh

This comment has been minimized.

kumarryogeshh commented Jun 9, 2017

Fixed using earlier versions. Try this

react-native init --version="0.42.0" AwesomeProject

@dioxide

This comment has been minimized.

dioxide commented Jun 10, 2017

same issues , look:
screen shot 2017-06-10 at 16 23 36

@xzf158

This comment has been minimized.

xzf158 commented Jun 15, 2017

I’ve got the same issue. :(

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Jun 15, 2017

I also have the same issue after updating from 0.44.0 > 0.45.1:

$ rm -rf node_modules/ && yarn cache clean && yarn install
$ ls node_modules/react-native/ (missing third-party directory)

Xcode build fails: 'config.h' file not found

$ node_modules/react-native/ios-install-third-party.sh or node_modules/react-native/scripts/ios-install-third-party.sh
$ ls node_modules/react-native/ (third-party directory found)

Xcode build succeeds.

Edit:
After running ios-install-third-party.sh once I can repeat $ rm -rf node_modules/ && yarn cache clean && yarn install after which the third-party is still missing, however a following Xcode build now correctly creates the third-party by itself and the builds succeeds.

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Jun 15, 2017

Building my parent / main project still fails:
I multiple of these errors:

Undefined symbols for architecture x86_64:
  "folly::detail::formatBinary", referenced from:

I also noticed that the files linked from the React project are wrong/missing. For example:
node_modules/react-native/React/folly-2016.09.26.00/folly/dynamic.cpp
node_modules/react-native/React/glog-0.3.4/src/config.h
Which doesn't exist.

If I build a new project using react-native init the same files in the React project have these link:
node_modules/react-native/third-party/folly-2016.09.26.00/folly/dynamic.cpp
node_modules/react-native/third-party/glog-0.3.4/src/config.h
Which do exist.

(btw I'm not using CocoaPods)

@redak105

This comment has been minimized.

redak105 commented Jun 15, 2017

I have same problem at version 0.45.0 and 0.45.1.
In Xcode have added Third party (folly, glog, double-conversion) in React project, which are not exist at path set in project.

I am using npm version 5.0.3.

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Jun 15, 2017

My above comment about files that are not linked correctly solved by itself so I don't think the errors were related to that at all:

  1. $ rm -rf node_modules/ && yarn cache clean && yarn install
  2. $ open node_modules/react-native/React/React.xcodeproj/
  3. Observe path of node_modules/react-native/React/glog-0.3.4/src/demangle.h: wrong & missing
  4. Build the project (succeeds)
  5. Observe path of node_modules/react-native/React/glog-0.3.4/src/demangle.h: still wrong & missing
  6. Quit Xcode
  7. $ open node_modules/react-native/React/React.xcodeproj/
  8. Observe path of node_modules/react-native/third-party/glog-0.3.4/src/config.h: corrected with /third-party & exists.

Basically the paths were changed / fixed after a successful build of the React project. Xcode just didn't refresh the paths correctly.

I still get the same folly::detail::formatBinary related errors as @dioxide

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Jun 15, 2017

Finally fixed the folly::detail::formatBinary related errors. They were caused by the -all_load flag in my Other Linker Flags.

@joncursi

This comment has been minimized.

Contributor

joncursi commented Jun 18, 2017

For me, removing third-party allow the app to build on iOS, but it breaks the build on Android:

FAILURE: Build failed with an exception.

* What went wrong:
Could not list contents of '/Users/jcursi/Sites/joncursi/redbirdNative/node_modules/react-native/third-party/glog-0.3.4/test-driver'. Couldn't follow symbolic link.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

So I need to reinstall node_modules to get third-party back before building for Android, but then immediately delete it again to get the iOS build to work.

Aside from DX, the potential problem I noticed with doing this is when I reinstall node_modules over again for Android, some of the dependencies in my dependency map (either direct or indirect) are being upgraded (if updates are available) due to non-strict semantic versioning. So the iOS build and the Android builds are often not using the same exact dependencies, which hopefully won't cause any bugs or variance... but it could.

@doyouno

This comment has been minimized.

doyouno commented Jun 19, 2017

you can just install glog yourself to solve this program.
cd /glog then
./configure
make
make install

build in Xcode again, problem never comes back .

@SudoPlz

This comment has been minimized.

Contributor

SudoPlz commented Jun 20, 2017

For me:

  • deleting the node_modules
  • npm cache verify (Because I'm using npm version 5.0.3)
  • npm install
  • Xcode Clean
  • Xcode Run

did the trick!

@win-design

This comment has been minimized.

win-design commented Jun 25, 2017

just use previous version 0.44
react-native init --version="0.44.0" YourAPP
till the issue resolved By R-N team
👍 1

@Ignigena

This comment has been minimized.

Ignigena commented Jul 5, 2017

Running into the same issue here after upgrading from 0.44. None of the above solutions or clearing caches did the trick for me. Here's what I did to get things working again:

  • 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
@Jiujiale

This comment has been minimized.

Jiujiale commented Jul 6, 2017

It works ! thank u @Ignigena

@messense

This comment has been minimized.

messense commented Jul 6, 2017

Same issue with RN 0.46

@MihaiDamian

This comment has been minimized.

MihaiDamian commented Jul 6, 2017

This is not a problem only for upgrades. I get the same error even on new RN 0.46 projects.

@gonglong

This comment has been minimized.

gonglong commented Jul 7, 2017

@Ignigena thanks! It works for me.

@wellyshen

This comment has been minimized.

wellyshen commented Jul 8, 2017

@Ignigena Thanks man

@AlexeyZich

This comment has been minimized.

AlexeyZich commented Jul 9, 2017

@Ignigena, Thank you for your help! It works

@ujwal-setlur

This comment has been minimized.

ujwal-setlur commented Jul 10, 2017

Running into the same issue. rn 0.46 is completely broken for me. Reverting to 0.44

@ujwal-setlur

This comment has been minimized.

ujwal-setlur commented Jul 10, 2017

@Ignigena, when I followed your steps, the build worked, but app crashed on my phone. Interestingly enough react-native run-ios for the simulator was working all the time. Only when I tried to build on Xcode for my phone did I have issues.

@ujwal-setlur

This comment has been minimized.

ujwal-setlur commented Jul 10, 2017

Looks like this is fixed in 0.47-RC. Hopefully, they will roll a 0.46.1 out with this fix:

5c53f89

@habil

This comment has been minimized.

habil commented Jun 20, 2018

When i create a new project with react-native version 2.0.1, i see same problem before mentioned. If you created any project before copy third-party folder from there or just download it from here : https://github.com/AgNm/third-party and past it to node_modules/react-native.
This workaround worked for me.

@pottspotts

This comment has been minimized.

pottspotts commented Jun 25, 2018

@Ignigena is correct.

I just had this issue with the latest react and xcode as of today (10b2). Resolved.

@TrustTheBoy TrustTheBoy referenced this issue Jun 28, 2018

Closed

'config.h' file not found #19529

4 of 5 tasks complete
@samridhgupta

This comment has been minimized.

samridhgupta commented Jul 17, 2018

I got it fixed by following this steps:

  1. Close Xcode.
  2. cd <Project-Folder>/node_modules/react-native/third-party/glog-0.3.4
  3. Run ./configure
  4. Run make
  5. Run make install
  6. Open Xcode and try building the Project.

Hope this solves the issue

@lesismo

This comment has been minimized.

lesismo commented Jul 24, 2018

what worked for me:

yarn cache clean
rm -rf node_modules
yarn install

@stepheljobs

This comment has been minimized.

stepheljobs commented Aug 16, 2018

Fix my bug.

rm -rf node_modules/ && yarn cache clean && yarn install
node_modules/react-native/scripts/ios-install-third-party.sh

from @mattijsf

@lucasfernandes

This comment has been minimized.

lucasfernandes commented Sep 10, 2018

Thank you @Ignigena!

Your solution was the only that really worked for me.

@lyon007

This comment has been minimized.

lyon007 commented Sep 11, 2018

Thank you everyone, I solved my problem.

i am
macOS 10.13.6
"react-native": "0.56.1"

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

hope to help friends who have the same problem.

@ftao123

This comment has been minimized.

ftao123 commented Sep 12, 2018

@coicoichip xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.
See man xcode-select for more details.

sudo xcode-select --switch path/to/Xcode.app The path to Xcode.app carried out xcode-select --switch Xcode.app

@akjesto

This comment has been minimized.

akjesto commented Sep 14, 2018

Running into the same issue here after upgrading from 0.44. None of the above solutions or clearing caches did the trick for me. Here's what I did to get things working again:

  • 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

I tried the above code, then I got the following error like
configure: error: in /Users/macmini1/Downloads/react-native-youtube-master/example/node_modules/react-native/third-party/glog-0.3.4': configure: error: C compiler cannot create executables See config.log' for more details

I solved by using the following command

$ ./configure --host arm-apple-darwin

@IljaDaderko

This comment has been minimized.

IljaDaderko commented Sep 18, 2018

Just received same issue with v 0.56.0, seems to be ongoing? This was for existing project.

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Sep 18, 2018

This is a returning issue every now an then. This time I got it after upgrading to Xcode 10. The steps from @lyon007 worked for me.

@kristfal

This comment has been minimized.

kristfal commented Sep 18, 2018

Same issue as @mattijsf, upgrade to Xcode 10 GM and a yarn install caused this and #16106 for some reason

@0x6e6562

This comment has been minimized.

0x6e6562 commented Sep 18, 2018

Just got this with 0.50.4 and the steps from @lyon007 did the trick.

@mattijsf

This comment has been minimized.

Contributor

mattijsf commented Sep 19, 2018

For everyone else getting the error when building for devices in Xcode 10:

No member named '__rip' in '__darwin_arm_thread_state64'

Do not use ./configure to build glog. That will produce a broken config.h in Xcode 10. Use this instead:
cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh

Note that the version in the path might differ per react-native version...

@griable

This comment has been minimized.

griable commented Sep 20, 2018

In my case, it was actually related to having Xcode app named Xcode 9.4.1.
Renaming it to Xcode.app as specified in this comment solved the issue.

@caijiang

This comment has been minimized.

caijiang commented Sep 21, 2018

thank you! @Ignigena
your solution still works for 0.55.2.

Environment

Environment:
OS: macOS High Sierra 10.13.6
Node: 10.10.0
Yarn: 1.9.4
npm: 6.4.1
Watchman: 4.9.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
react: 16.3.2 => 16.3.2
react-native: 0.55.2 => 0.55.2

@romk1n

This comment has been minimized.

romk1n commented Sep 25, 2018

I am getting ./ios-install-third-party.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 119 0 119 0 0 172 0 --:--:-- --:--:-- --:--:-- 172 100 510k 100 510k 0 0 330k 0 0:00:01 0:00:01 --:--:-- 4185k curl: Saved to filename 'glog-0.3.4.tar.gz' Unpacking /Users/roman/.rncache/glog-0.3.4.tar.gz... ./ios-install-third-party.sh: line 56: ./ios-configure-glog.sh: No such file or directory when trying to execute @lyon007 steps, anyone has a clue? running Xcode 10.

@pvinis

This comment has been minimized.

Contributor

pvinis commented Sep 25, 2018

be in node_modules/react-native folder.

run ./scripts/ios-install-third-party.sh.

go to node_modules/react-native/third-party/glog-0.3.4.

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

done.

@hramos

This comment has been minimized.

Contributor

hramos commented Sep 25, 2018

Re-opening as it looks like the introduction of Xcode 10 has re-surfaced the issue. For future reference, please open a new issue if you find a closed issue with many comments claiming it's still happening. Comments on closed issues like this one generally go unnoticed by us maintainers.

@hramos hramos reopened this Sep 25, 2018

@hramos hramos changed the title from [0.45.0] third-party: 'config.h' file not found to Xcode 10: third-party: 'config.h' file not found Sep 25, 2018

@hramos

This comment has been minimized.

Contributor

hramos commented Sep 25, 2018

Actually, on a closer look, this appears to be covered already in #20774, which is still open. The root cause is projects using the new build system fail to run the third party install script at the right time. I'm closing this again, and please use #20774 as the central place to discuss solutions to the root cause.

Duplicate of #20774

@hramos hramos closed this Sep 25, 2018

@facebook facebook locked as too heated and limited conversation to collaborators Sep 25, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.