firebase-ios-sdk: [iOS] Error building Firebase, gRPC-C++ fatal error: 'chrono' file not found
- Xcode version: 10
- Firebase SDK version: 5.8.0 / 5.9.0
Describe the problem
Compilation fails when try to build react-native app based in Firebase (using react-native-firebase), the error says it can’t find ‘chrono’ file:
../../../ios/Pods/Headers/Public/gRPC-C++/grpcpp/impl/codegen/time.h:22:10: fatal error: 'chrono' file not found
#include <chrono>
^~~~~~~~
PD: I’ve already opened an issue at gRPC project…
Steps to reproduce:
Just create a react native app, and follow the instructions to install react-native-firebase, then run react-native run-ios.
Cocoapods:
╰─ pod install
Analyzing dependencies
Downloading dependencies
Using BoringSSL (10.0.6)
Using Firebase (5.9.0)
Using FirebaseAnalytics (5.2.0)
Using FirebaseAuth (5.0.4)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.4)
Using FirebaseFirestore (0.13.4)
Using FirebaseInstanceID (3.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.2.0)
Using GoogleUtilities (5.3.0)
Using Protobuf (3.6.1)
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)
Using leveldb-library (1.20)
Using nanopb (0.3.8)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 19 total pods installed.
Report:
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 **
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 32 (7 by maintainers)
Commits related to this issue
- [v5] Remove recursive header search from ios podspec I believe following commit introduces an issue fro cocoapods users (of whoom there will be many now that react-native uses cocoapods) https://gith... — committed to invertase/react-native-firebase by iljadaderko 5 years ago
- [v5] Revert recursive header search from ios podspec (#2328) I believe following commit introduces an issue for cocoapods users (of whoom there will be many now that react-native uses cocoapods) http... — committed to invertase/react-native-firebase by iljadaderko 5 years ago
See my reply in detail here: https://github.com/firebase/firebase-ios-sdk/issues/2260#issuecomment-461601816.
In short, your project is misconfigured such that HEADER_SEARCH_PATHS is somehow picking up files that are under the Pods directory. Scrutinize all recursive entries carefully.
I’ve been able to resolve this issue by setting the build system to
Legacy.PROJECT_NAME.workspacefileFile > Workspace SettingsBuild System > Legacy Build SystemWill try out @noahtallen solution next, since we have to make the switch to the
New Build Systemeventually…I’ve been getting this exact same error too. Super frustrating. I had turned the legacy build system on to “fix” it, but on a hunch, I started importing RNFirebase via pods rather than via the link step. Then I turned on the new build system, cleaned the build folder, and it all works now. Maybe something about compiling the project through Pods rather than through a manual import fixes it.
To make the switch, add
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'to your Podfile and remove the existing RNFirebase references from your Xcode project. Also run pod update after this.I’m going try to build for production on CI and see if it works there as well.
Update: the archive step works on CI
@wilhuff The instructions for getting this starter project going, with MacOS High Sierra and XCode 10.1 seem to reproduce it: https://github.com/invertase/react-native-firebase-starter
Your problem here relates to the Xcode header map. The specific problem is that gRPC-C++ includes a file named time.h and there’s a system header with the same name.
gRPC-C++ disables the header map for itself, but that’s apparently not enough. Disable the setting “Use header maps” in your project to proceed.
This doesn’t affect the build, still broken
@wilhuff THANK YOU SO MUCH!!! THANK YOU!!! send me a pm on twitter “https://twitter.com/cyrus_zei” with your paypal info and I will send you the 100$. You don’t know how much you helped me! I am crying right now
As @wilhuff mentioned, this should be an issue with misconfiguration of HEADER_SEARCH_PATHS or related settings by CocoaPods. Removing
$(SRCROOT)/Pods/fromTARGETS -> Build Settings -> Header Search Pathswill fix this issue.@peteralen Thanks a lot man! Been on this for a day and this solved for me!
@FullstackJack Here’s my current pod file. I’m not 100% on what/why of the subspecs, since I use a ton of stuff from react-native that seems as if it should use a subspec that I haven’t specified. My guess is that some of the react-native stuff has been manually linked at some point, perhaps at setup. This project is more than a year old and has been through a few react-native updates 😛