grpc: gRPC-C++ time.h fails to complie: fatal error: 'chrono' file not found

Hi,

I’m building a react-native app that use Firebase (5.9.0), that depends on gRPC-cpp. When I try to build the project if fails becasue the file chrono.h cannot be found:

While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:11:
In file included from <module-includes>:33:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/wchar.h:91:
In file included from ../../../ios/Pods/Headers/Public/gRPC-C++/grpcpp/support/time.h:22:
../../../ios/Pods/Headers/Public/gRPC-C++/grpcpp/impl/codegen/time.h:22:10: fatal error: 'chrono' file not found
#include <chrono>
         ^~~~~~~~
1 error generated.
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:11:10: fatal error: could not build module 'Darwin'
#include <stdbool.h>
 ~~~~~~~~^
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:16:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:10: fatal error: could not build module 'Darwin'
#include <sys/types.h>
 ~~~~~~~~^
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:16:
While building module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/dispatch/dispatch.h:25:10: fatal error: could not build module 'Darwin'
#include <Availability.h>
 ~~~~~~~~^
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:16:
While building module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
While building module 'os_object' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/dispatch/dispatch.h:48:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/os/object.h:25:10: fatal error: could not build module 'Darwin'
#include <Availability.h>
 ~~~~~~~~^
1 error generated.
2 errors generated.
3 errors generated.
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/
Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation'
#include <CoreFoundation/CoreFoundation.h>
 ~~~~~~~~^
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:
While building module 'ObjectiveC' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/./objc-exception.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/objc.h:31:10: fatal error: could not build module 'Darwin'
#include <sys/types.h>      // for __DARWIN_NULL
 ~~~~~~~~^
1 error generated.
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:
While building module 'Security' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:27:10: fatal error: could not build module 'Darwin'
#include <TargetConditionals.h>
 ~~~~~~~~^
1 error generated.
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:
While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:17:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h:19:10: fatal error: could not build module 'CoreFoundation'
#include <CoreFoundation/CoreFoundation.h>
 ~~~~~~~~^
1 error generated.
4 errors generated.
While building module 'QuartzCore' imported from /Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:
While building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:8:10: fatal error: could not build module 'Foundation'
#include <Foundation/Foundation.h>
 ~~~~~~~~^
1 error generated.
10 errors generated.
In file included from /Users/mtz/Development/read_it_later___anterior/node_modules/react-native-firebase/ios/RNFirebase/converters/RCTConvert+UIBackgroundFetchResult.m:1:
In file included from /Users/mtz/Development/read_it_later___anterior/node_modules/react-native-firebase/ios/RNFirebase/converters/RCTConvert+UIBackgroundFetchResult.h:1:
/Users/mtz/Development/read_it_later___anterior/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTConvert.h:8:9: fatal error: could not build module 'QuartzCore'
#import <QuartzCore/QuartzCore.h>
 ~~~~~~~^


** BUILD FAILED **

What version of gRPC and what language are you using?

Objective-C (iOS)

Using gRPC (1.14.0) Using gRPC-C++ (0.0.3) Using gRPC-Core (1.14.0) Using gRPC-ProtoRPC (1.14.0) Using gRPC-RxLibrary (1.14.0)

What operating system (Linux, Windows, …) and version?

Mac OS Sierra

What runtime / compiler are you using (e.g. python version or version of gcc)

XCode 10 (iOS)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@wilhuff I disabled the “Use Header Maps”, still i am getting the error. I am using Xcode: 9.4.1 react-native-cli: 2.0.1 react-native: 0.57.1

screen shot 2018-10-14 at 7 11 01 am

Looks like something outside gRPC. Closing this issue unless there’s more concerns on gRPC’s pod configurations.

I am having the same problem, see my post https://github.com/facebook/react-native/issues/18793 at the bottom. still looking for a solution.