Skip to content
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

[iOS] Error building Firebase, gRPC-C++ fatal error: 'chrono' file not found #1916

Closed
mtzfactory opened this issue Oct 6, 2018 · 32 comments
Closed

Comments

@mtzfactory
Copy link

  • 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 **
@mtzfactory
Copy link
Author

Hi again,

I just updated to Firebase 5.7.0 and the same app builds and runs perfectly. It seems this version doesn't use gRPC-C++

╰─ pod update
Update all pods
Updating local specs repositories
  $ /usr/bin/git -C /Users/mtz/.cocoapods/repos/master fetch origin --progress
  remote: Enumerating objects: 47, done.
  remote: Counting objects: 100% (47/47), done.
  remote: Compressing objects: 100% (33/33), done.
  remote: Total 36 (delta 21), reused 0 (delta 0), pack-reused 0
  From https://github.com/CocoaPods/Specs
     88447189ba9..9a7161b8bdf  master     -> origin/master
  $ /usr/bin/git -C /Users/mtz/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/mtz/.cocoapods/repos/master reset --hard origin/master
  HEAD is now at 9a7161b8bdf [Add] VercettiPrompt 1.0.0
Analyzing dependencies
Removing BoringSSL
Removing gRPC-C++
Downloading dependencies
Installing BoringSSL-GRPC (0.0.2)
Installing Firebase 5.7.0 (was 5.8.1)
Installing FirebaseAnalytics 5.1.1 (was 5.1.4)
Installing FirebaseAuth 5.0.3 (was 5.0.4)
Using FirebaseAuthInterop (1.0.0)
Installing FirebaseCore 5.1.2 (was 5.1.3)
Installing FirebaseFirestore 0.13.2 (was 0.13.3)
Installing FirebaseInstanceID 3.2.1 (was 3.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.2.0)
Installing GoogleUtilities 5.2.3 (was 5.3.0)
Using Protobuf (3.6.1)
Installing gRPC 1.15.1 (was 1.14.0)
Installing gRPC-Core 1.15.1 (was 1.14.0)
Installing gRPC-ProtoRPC 1.15.1 (was 1.14.0)
Installing gRPC-RxLibrary 1.15.1 (was 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 18 total pods installed.

@wilhuff
Copy link
Contributor

wilhuff commented Oct 7, 2018

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.

@wilhuff wilhuff closed this as completed Oct 7, 2018
@julo15
Copy link

julo15 commented Oct 11, 2018

I've been trying to get this working by disabling the header map and using 5.9.0 (i.e. not downgrading). Our build is succeeding locally always, but failing about 50% of the time on Buddybuild.

I'm wondering if anyone has successfully got this working via disabling the header map?

@tijunoi
Copy link

tijunoi commented Oct 11, 2018

Nope, I've been trying for two days for all Firebase / RNFirebase version combos without success.
Somehow I got it to work yesterday removing some library links and adding them again, but I can't remember which ones. It worked for a few hours until I had to pod install again.

@codeflows
Copy link

Our builds are also failing on CircleCI somewhat randomly. Have tried tweaking the header map settings in our own project but to no avail. But, the errors I'm seeing are originating in RNFirebase so I guess this should be tracked there (see issue referenced above)

@tijunoi
Copy link

tijunoi commented Oct 11, 2018

I also tried messing with headers with no success. I just solved the build error deintegrating pods and installing Firebase 5.9.0 again. It still wasn’t working until I switched to Legacy Build System in Xcode. Don’t like it that much but that’ll do for now.

@conrado
Copy link

conrado commented Nov 5, 2018

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

@brenwell
Copy link

brenwell commented Nov 8, 2018

Any developments on this one?

@wilhuff
Copy link
Contributor

wilhuff commented Nov 9, 2018

Could someone share a project (ideally minimal) that's in this state? The steps to reproduce above are nontrivial. We don't formally support react native, don't test with it, and don't have a ton of experience with it. While I'd like to help I just don't have the kind of time it would take to reproduce this from the instructions above.

@conrado
Copy link

conrado commented Nov 9, 2018

@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

@wilhuff
Copy link
Contributor

wilhuff commented Nov 15, 2018

On macOS 10.13.6, with CocoaPods 1.5.3 I can't reproduce with:

  • Xcode 10.0, Firebase 5.11.0 (the current version referenced in react-native-firebase-starter project)
  • Xcode 10.1
  • Firebase 5.9.0 (the version in the first report)

I know this isn't a figment of your imagination, so there's got to be something else about your configuration that triggers this. Any ideas?

@csprl
Copy link

csprl commented Nov 16, 2018

Latest react-native-firebase-starter seems to succeed when building the workspace in Xcode, but not when running npm run ios which invokes xcodebuild -workspace <appname>.xcworkspace -configuration Debug -scheme <appname> -destination id=... -derivedDataPath build. I used fresh git repositories for each test.

macOS 10.14, Xcode 10.1 and CocoaPods 1.5.3.

@wilhuff
Copy link
Contributor

wilhuff commented Nov 16, 2018

That's what I'm doing. I also built directly in Xcode but that made no difference as far as I can see.

@noahtallen
Copy link

noahtallen commented Nov 20, 2018

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

@PJUllrich
Copy link

PJUllrich commented Nov 25, 2018

I've been able to resolve this issue by setting the build system to Legacy.

  1. Open the PROJECT_NAME.workspace file
  2. File > Workspace Settings
  3. Build System > Legacy Build System

Will try out @noahtallen solution next, since we have to make the switch to the New Build System eventually...

@FullstackJack
Copy link

FullstackJack commented Dec 1, 2018

@noahtallen

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

How do you handle the reference to React in Pod deps after that? What does your Podfile look like?

@noahtallen
Copy link

noahtallen commented Dec 1, 2018

@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 :P

platform :ios, '9.0'

target 'app' do
  rn_path= '../node_modules/react-native'
 
  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport',
    'RCTWebSocket',
    'RCTImage'
    # Add any other subspecs you want to use in your project
  ]

  # Required by the Facebook SDK:
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'

  # Required by Firebase (see rnfirebase.io to add more Firebase features) 
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
  pod 'Firebase/Core', '~> 5.11.0'
  pod 'Firebase/Analytics', '~> 5.11.0'
  pod 'Firebase/Auth', '~> 5.11.0'
  pod 'Firebase/Firestore', '~> 5.11.0'
  pod 'Firebase/Messaging', '~> 5.11.0'
  pod 'Firebase/Storage', '~> 5.11.0'
  pod 'Firebase/DynamicLinks', '~> 5.11.0'

  # For Crashlytics:
  pod 'Fabric', '~> 1.7.11'
  pod 'Crashlytics', '~> 3.10.7'

  # For react-native-maps
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-maps', path: rn_maps_path
  pod 'react-native-google-maps', path: rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  # For pictures & camera
  pod 'RNImageCropPicker', :path =>  '../node_modules/react-native-image-crop-picker'

  # Other random packages:
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  
  pod 'RNSVG', :path => '../node_modules/react-native-svg'

  pod 'RadarSDK', '~> 2.1.0'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-google-maps'
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
      end
    end
    targets_to_ignore = %w(React yoga)
    if targets_to_ignore.include? target.name
        target.remove_from_project
      end
    if target.name == "React"
      target.remove_from_project
    end
  end
end

@FullstackJack
Copy link

FullstackJack commented Dec 1, 2018

@noahtallen Yeah, the sub specs for RN is what I find most annoying about listing React in the podfile because there could be 30 or so. Thanks for posting this.

Your post install section looks like black magic voodoo. How did you decide to "remove" React pod from project and other bits?

@noahtallen
Copy link

That section isn’t really due to rhyme or reason, just to the fact that I’ve had to fix so many things with the build when upgrading different things.. and that’s basically how it has materialized over several months of that. I’m 100% sure that could be cleaned up. My guess is that react is manually linked and needs removed before pod link? I forget what it actually fixed at the time. I might spend some time messing around with that later now that you mention it. The google maps solution is specific to some build error we had with react-native-maps. Suffice to say that it does work now :p

@netizen01
Copy link

I've been fighting this issue for a few weeks.
Finally solved it ... somehow...
I use Pods and apparently over time my HEADER_SEARCH_PATHS had gotten customized at the project level. By deleting the project level customization (reverting to the Workspace setting which is set by CocoaPods) the issue went away. Something in my custom HEADER_SEARCH_PATHS was borking it.

Would suggest: delete your customized HEADER_SEARCH_PATHS at the project level.

@FullstackJack
Copy link

FullstackJack commented Dec 4, 2018

@noahtallen What does your xcworkspace project looks like? When I list React under Podfile, the Xcode project builds successfully but the Metro bundler complains about a duplicate module for react-native.

error: bundling failed: Error: jest-haste-map: Haste module naming collision:
  Duplicate module name: react-native
  Paths: /Users/user/develop/workspace/project/ios/Pods/React/package.json collides with /Users/user/develop/workspace/project/node_modules/react-native/package.json

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (/Users/user/develop/workspace/project/node_modules/jest-haste-map/build/index.js:551:17)
    at workerReply (/Users/user/develop/workspace/project/node_modules/jest-haste-map/build/index.js:613:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

@noahtallen
Copy link

I'm not sure if this is helpful, or even if it's optimal for us.
screen shot 2018-12-04 at 11 35 29 pm

It looks as if that's finding react-native's JS files through both Pods and node_modules, which is strange. Did you add the post install step, and then run pod install or pod update again? I believe they might help with that error - since those steps appear to remove React from the xcode project.... or something! Wouldn't be a bad idea to try cleaning the solution before building again.

@wilhuff
Copy link
Contributor

wilhuff commented Jan 23, 2019

Our current hypothesis is that project-level misconfiguration of HEADER_SEARCH_PATHS or related settings, possibly generated by CocoaPods, is the cause of this issue. We've been unable to reproduce this.

Closing this issue for now, but if someone is still experiencing this problem, please share a tarball of your project (i.e. after running pod install) so that we can continue diagnosis.

@wilhuff wilhuff closed this as completed Jan 23, 2019
@peteralen
Copy link

As @wilhuff mentioned, this should be an issue with misconfiguration of HEADER_SEARCH_PATHS or related settings by CocoaPods. Removing $(SRCROOT)/Pods/ from TARGETS -> Build Settings -> Header Search Paths will fix this issue.

@CyrusZei
Copy link

any fix for this ? I can give you project that has this error if you want to have a look at it?
Have been struggling with this problem for 4 days now with no luck. I am even giving you 100$ for your time.

@wilhuff
Copy link
Contributor

wilhuff commented Mar 19, 2019

See my reply in detail here: #2260 (comment).

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.

@CyrusZei
Copy link

@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

@wilhuff
Copy link
Contributor

wilhuff commented Mar 19, 2019

I’m glad you’re fixed up. I don’t twitter so don’t let randoms claim your money :-).

@CyrusZei
Copy link

I will share private repo with you with my email and then you can email me. You deserve this money <3

@CyrusZei
Copy link

invitation sent

@luco
Copy link

luco commented Apr 12, 2019

@peteralen Thanks a lot man! Been on this for a day and this solved for me!

xzilja pushed a commit to invertase/react-native-firebase that referenced this issue Jul 6, 2019
I believe following commit introduces an issue fro cocoapods users (of whoom there will be many now that react-native uses cocoapods) b85153d#diff-1b2b06e7c58d8929c91f917ce51a7454R28

The gist of it, that it introduces back this issue firebase/firebase-ios-sdk#1916
It is due to some header include in gRPC-C++ library that recursive header search will try to include, but won't find, hence causing build error.

cc @MoOx as he authored original PR, I am not sure if removing this will cause any issues, so wanted to discuss it with you.
Salakar pushed a commit to invertase/react-native-firebase that referenced this issue Jul 10, 2019
I believe following commit introduces an issue for cocoapods users (of whoom there will be many now that react-native uses cocoapods) b85153d#diff-1b2b06e7c58d8929c91f917ce51a7454R28

The gist of it, that it introduces back this issue firebase/firebase-ios-sdk#1916
It is due to some header include in gRPC-C++ library that recursive header search will try to include, but won't find, hence causing build error.

cc @MoOx as he authored original PR, I am not sure if removing this will cause any issues, so wanted to discuss it with you.
@roger-ngx
Copy link

roger-ngx commented Aug 2, 2019

I've been able to resolve this issue by setting the build system to Legacy.

  1. Open the PROJECT_NAME.workspace file
  2. File > Workspace Settings
  3. Build System > Legacy Build System

Will try out @noahtallen solution next, since we have to make the switch to the New Build System eventually...

this solved my issue: expo SDK 34, react-native-firebase 5.5.6

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

No branches or pull requests