react-native-maps: 'Google-Maps-iOS-Utils/GMUKMLParser.h' file not found while building XCode

Bug

I initially had react-native 0.58.6 installed alongside react-native-maps 0.23.0, and everything was perfect, maps working etc.

I then tried upgrading to react-native 0.59.8, and as part of that for Android, I had to update the react-native-maps plugin to 0.24.2, which then worked fine. I then tried to build Xcode, and ran into the issue below.

Screenshot 2019-05-21 at 22 19 18

I tried a couple of solutions, but nothing I have tried so far worked. The strange thing is that even when I rollback to the previous version of the plugin and react-native, I am now totally unable to build my Xcode project, without getting this error. I have even gone so far as to delete Xcode, and my projects to delete out any temporary files that may have caused these issues, but for whatever reason, I simply cannot build.

The files that are apparently missing are definitely there.

Screenshot 2019-05-21 at 22 26 41

That specific package does seem to be missing from the linked headers, but even if I do add it in there, it doesn’t seem to fix the error (even after I cleaned the project first)

Screenshot 2019-05-21 at 22 28 50

My podfile is below:

platform :ios, '9.0'

target 'Olio' do
  rn_path = '../node_modules/react-native'
  rn_maps_path = '../node_modules/react-native-maps'

  pod 'Fabric', '~> 1.10.1'
  pod 'Crashlytics', '~> 3.13.0'

  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
  pod 'React', path: rn_path, subspecs: [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]

  pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec"

  pod 'react-native-maps', path: rn_maps_path
  pod 'react-native-google-maps', path: rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
  pod 'lottie-ios', :path => '../node_modules/lottie-ios'
  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
  pod 'react-native-fast-image', :path => '../node_modules/react-native-fast-image'
  pod 'ReactNativeKeyboardManager', :path => '../node_modules/react-native-keyboard-manager'
  pod 'react-native-mixpanel', :path => '../node_modules/react-native-mixpanel'
  pod 'Firebase/Core', '~> 5.15.0'
  pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
  pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

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
      if target.name == "React"
            target.remove_from_project
        end
    end
end

Environment info

React native info output:

 
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 4.34 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
      Yarn: 1.15.2 - ~/.yarn/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v10.15.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 24, 25, 26, 27, 28
        Build Tools: 26.0.3, 27.0.3, 28.0.3
        System Images: android-23 | Intel x86 Atom_64, android-24 | Intel x86 Atom_64, android-25 | Android TV Intel x86 Atom, android-25 | Intel x86 Atom_64, android-26 | Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.6 => 0.58.6 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Library version: 0.24.2

Steps To Reproduce

Since I have exhausted all other avenues, I thought I’ll log a bug report, I am surprised no-one else has run into something similar recently, and I can’t figure out what I am doing wrong.

It seems at least two other people are also experiencing the same issue: https://github.com/react-native-community/react-native-maps/issues/2066#issuecomment-493246746

https://github.com/react-native-community/react-native-maps/issues/2066#issuecomment-494229202

Any advice gladly welcomed!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 30

Most upvoted comments

it’s cocoapods 1.7.0 Header path issue. CocoaPods/CocoaPods#8836 when you change Google-Maps-iOS-Utils to Google_Maps_iOS_Utils, and all works.

#import <Google_Maps_iOS_Utils/GMUKMLParser.h>
#import <Google_Maps_iOS_Utils/GMUPlacemark.h>
#import <Google_Maps_iOS_Utils/GMUPoint.h>
#import <Google_Maps_iOS_Utils/GMUGeometryRenderer.h>

Just a note for anyone using App Center, as a workaround you can add a appcenter-post-clone.sh file at the root of your project with the following contents to ensure that your remote build uses a working version of cocoapods.

#!/usr/bin/env bash
#
# Removes the latest version of CocoaPods  which may have lack of backward compatibilities
# Installs version 1.5.3 which has no compatibility issues
# 1.5.3 can be changed to another version you'd prefer

echo "running post-clone scripts"
echo "uninstalling all cocoapods versions"
sudo gem uninstall cocoapods -ax
echo "installing cocoapods version 1.5.3"
sudo gem install cocoapods -v 1.5.3

Hopefully this is of use to someone!

it’s cocoapods 1.7.0 Header path issue. CocoaPods/CocoaPods#8836 when you change Google-Maps-iOS-Utils to Google_Maps_iOS_Utils, and all works.

#import <Google_Maps_iOS_Utils/GMUKMLParser.h>
#import <Google_Maps_iOS_Utils/GMUPlacemark.h>
#import <Google_Maps_iOS_Utils/GMUPoint.h>
#import <Google_Maps_iOS_Utils/GMUGeometryRenderer.h>

This fixed the issue locally, so thanks! Im wondering how this will now work with a team. Do I now have to tell them to each do the same thing? Will this be something that is fixed soon?

Cocoapods team fixed and merged. wait for cocoapods new release.

Haha great to hear I’m not the only one, will let you know if I manage to make any progress.

Same identical scenario as yours letter by letter and version to version!

@jacquesdev @mwcm @stevenheffner Here how I fixed it through a this comment.

Only difference is I have downgraded react-native-maps to: "react-native-maps": "^0.19.0",

And it worked perfectly.

For me what worked was replacing the problematic import to a relative path. Example:

#import <Google_Maps_iOS_Utils/GMUKMLParser.h>
#import "GMUKMLParser.h"

@stevenheffner Whatever man, at least it gives a room to breathe and deliver 😄