Skip to content

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

Closed
@joncursi

Description

@joncursi
Contributor

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?

Activity

Tom-Bonnike

Tom-Bonnike commented on Jun 8, 2017

@Tom-Bonnike

I’ve got the same issue. :(

javache

javache commented on Jun 8, 2017

@javache
Member

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

javache

javache commented on Jun 8, 2017

@javache
Member

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

Tom-Bonnike commented on Jun 8, 2017

@Tom-Bonnike

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

javache commented on Jun 8, 2017

@javache
Member

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

javache

javache commented on Jun 8, 2017

@javache
Member

Sorry, I meant the react-native folder.

Tom-Bonnike

Tom-Bonnike commented on Jun 9, 2017

@Tom-Bonnike

@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

kumarryogeshh commented on Jun 9, 2017

@kumarryogeshh

Fixed using earlier versions. Try this

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

dioxide

dioxide commented on Jun 10, 2017

@dioxide

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

xzf158

xzf158 commented on Jun 15, 2017

@xzf158

I’ve got the same issue. :(

mattijsf

mattijsf commented on Jun 15, 2017

@mattijsf
Contributor

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

mattijsf commented on Jun 15, 2017

@mattijsf
Contributor

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

redak105 commented on Jun 15, 2017

@redak105

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

mattijsf commented on Jun 15, 2017

@mattijsf
Contributor

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

mattijsf commented on Jun 15, 2017

@mattijsf
Contributor

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

151 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @javache@0x6e6562@lucasfernandes@peterp@Frexuz

        Issue actions

          Xcode 10: third-party: 'config.h' file not found · Issue #14382 · facebook/react-native