cordova-plugin-googlemaps: 'GoogleMaps/GoogleMaps.h' file not found

I’m submitting a … (check one with “x”)

  • question
  • any problem or bug report

OS: (check one with “x”)

  • Android
  • iOS
  • Browser

cordova information: (run $> cordova plugin list)

com.unarin.cordova.beacon 3.7.0 "Proximity Beacon Plugin"
cordova-android-play-services-gradle-release 1.4.1 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-custom-config 4.0.2 "cordova-custom-config"
cordova-plugin-admobpro 2.31.6 "AdMob Plugin Pro"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-email-composer 0.8.3 "EmailComposer"
cordova-plugin-extension 1.5.4 "Cordova Plugin Extension"
cordova-plugin-flashlight 3.2.0 "Flashlight"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-googlemaps 2.4.6 "cordova-plugin-googlemaps"
cordova-plugin-image-picker 1.1.1 "ImagePicker"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-iroot 0.8.0 "iRoot"
cordova-plugin-mock-location-checker 1.0.1 "MockLocationChecker"
cordova-plugin-multi-window 0.0.3 "cordova-plugin-multi-window"
cordova-plugin-nativestorage 2.2.2 "NativeStorage"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-touchid 0.4.0 "Touch ID"
cordova-plugin-transport-security 0.1.2 "App Transport Security"
cordova-plugin-vibration 2.1.1 "Vibration"
cordova-plugin-whitelist 1.2.3-dev "Whitelist"
cordova-plugin-x-socialsharing 5.1.3 "SocialSharing"
cordova-sqlite-storage 0.7.14 "Cordova sqlite storage plugin"
de.appplant.cordova.plugin.local-notification 0.8.4 "LocalNotification"
org.devgeeks.Canvas2ImagePlugin 0.6.0 "Canvas 2 Image"
phonegap-plugin-barcodescanner 7.1.2 "BarcodeScanner"
phonegap-plugin-push 1.8.4 "PushPlugin"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

@ionic-native/core : 
@ionic-native/google-maps : 

Current behavior:

Expected behavior:

Screen capture or video record:

screen shot 2561-09-26 at 14 03 56

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 47 (17 by maintainers)

Most upvoted comments

Congrats, guys.

Ok, let’s make a conclusion. Regarding of the reports, the following steps should solve this problem.

$> cordova platform rm ios
$> cordova plugin rm cordova-plugin-googlemaps

$> [sudo] gem install cocoapods
or
$ brew update
$ brew upgrade cocoapods
$ pod setup

// confirm
$>  pod --version
1.4.0 or above should be fine.


$> cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ ...

$> cordova platform add ios

If the above steps does not work, try this:

$> cd (your project)/platforms/ios/

$> pod update
Update all pods
Updating local specs repositories
...
Analyzing dependencies
Downloading dependencies
Using GoogleMaps (2.7.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

I thank you for the plugin; we use this as one of the core plugins for our app. But you should not be introducing breaking changes on the minor version change… If you now require Cocoapods you should make the version 2.5.1 after 2.4.4. Not 2.4.5 after 2.4.4. These updates cause a world of pain for developers using it.

cocoapod is the official supported way of cordova cli (since cordova-cli 6.4.0 and ios 4.3.0) Everyone should have it, and should work it. Even on Windows, Visual Studio support it.

So switching the installing from git repo to cocoapod is not a breaking change. Main code is not changed at all.

Here is how to install cocoapod https://stackoverflow.com/a/25257238/697856

And if you already cocoapod is installed, your cocoapod is older version. You need to upgrade it.

$ [sudo] gem install cocoapods

or

$ brew update
$ brew upgrade cocoapods
$ pod setup

I don’t know why Google Maps not install when install your plugin. I try any way to install Google Maps. But not work.

- remove your plugin 
- sudo gem install cocoapods
- pod setup
- install your plugin

Not work ‘GoogleMaps/GoogleMaps.h’ file not found

Only way to install Google Maps via Pod I need remove iOS Platform and add iOS Platform back

I see Google Maps is installing when Add Platform but if just remove plugin and reinstall plugin Google Maps not install

I don’t know why

cordova requirements

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.4/bin/gradle

Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]
CocoaPods: installed [object Object]

ionic info

Cordova CLI: 7.1.0 
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
ios-deploy version: 1.9.2 
ios-sim version: 6.1.2 
OS: macOS
Node Version: v6.9.1
Xcode version: Xcode 9.4.1 Build version 9F2000

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14 (18A389)
       Xcode : 9.4.1 (9F2000)
         Git : git version 2.15.2 (Apple Git-101.1)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 5ef5292700fef82ece5c45051498cd9cbfec6b38

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Remove Plugin (2.4.4)

MBPX:TimeMint MisterX$ cordova plugin remove cordova-plugin-googlemaps
Uninstalling cordova-plugin-googlemaps from android
Subproject Path: CordovaLib
Uninstalling 1 dependent plugins.
Uninstalling com.googlemaps.ios from ios
Uninstalling cordova-plugin-googlemaps from ios
Removing "cordova-plugin-googlemaps"
Removing plugin cordova-plugin-googlemaps from config.xml file...
Removing cordova-plugin-googlemaps from package.json
MBPX:TimeMint MisterX$ 

Install Plugin (2.4.6)

MBPX:TimeMint MisterX$ cordova plugin add cordova-plugin-googlemaps@latest --variable API_KEY_FOR_ANDROID="XXXXXXXXXXXXXXXXXXXXXXXX" --variable API_KEY_FOR_IOS="XXXXXXXXXXXXXXXXXXXXXXXX"
Installing "cordova-plugin-googlemaps" for android
ANDROID_HOME=/Users/MisterX/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
Subproject Path: CordovaLib
Starting a Gradle Daemon (subsequent builds will be faster)
+-----------------------------------------------------------------
| cordova-android-play-services-gradle-release: 15.+
+-----------------------------------------------------------------
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
null
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_bfignb13foi2d7hca08lab1nk.run(/Users/MisterX/Documents/TimeMint/platforms/android/build.gradle:149)
org.xwalk:xwalk_core_library:23+
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:clean
:CordovaLib:clean

BUILD SUCCESSFUL

Total time: 9.565 secs
Subproject Path: CordovaLib

      Official document https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.3.0/README.md Please consider to buy a beer for us 🍺 https://github.com/mapsplugin/cordova-plugin-googlemaps#buy-us-a-beer
    
Installing "cordova-plugin-googlemaps" for ios
--[cordova-plugin-googlemaps]------------------------
From version 2.4.5, the cordova-plugin-googlemaps uses CocoaPod.
No longer necessary com.googlemaps.ios plugin.
Automatic uninstalling com.googlemaps.ios plugin...
-----------------------------------------------------
Uninstalling com.googlemaps.ios from android
Uninstalling com.googlemaps.ios from ios
Removing "com.googlemaps.ios"
Removing plugin com.googlemaps.ios from config.xml file...
Removing com.googlemaps.ios from package.json


      Official document https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.3.0/README.md Please consider to buy a beer for us 🍺 https://github.com/mapsplugin/cordova-plugin-googlemaps#buy-us-a-beer
    
Adding cordova-plugin-googlemaps to package.json
Saved plugin info for "cordova-plugin-googlemaps" to config.xml
MBPX:TimeMint MisterX$ 

This worked for me:

cd platforms/ios/myApp
pod deintegrate
pod install

I think I found the culprit, I miss the part of running pod update within the platform/ios directory. With that being done now the issue is resolved. Thanks again @wf9a5m75 .

yes I know I open .xcworkspace file but all day it not work. I check a Podfile no GoogleMaps line

but now I have pod 'GoogleMaps', '~> 2.7.0' in Podfile

screen shot 2561-09-27 at 02 35 59

After I see pod 'GoogleMaps', '~> 2.7.0' I know Goole Maps will install 😆 and yes it installed lol

Thank you for any support.

If you want to open your project with xcode, you need to open (your project).xcworkspace file, not (your project).xcodeproj file.

screen shot 2018-09-26 at 12 30 29 pm

IT WORK

I don’t know why again lol but now just remove and install plugin version 2.4.6 Google Maps is installed via Pods

WHY? in a day not work -*-

I lost all day to fix this

and now I don’t know why it work lol

screen shot 2561-09-27 at 02 21 27

Although this problem is already solved, and it is not a bug of this plugin, I keep this thread is open for other people for a while.

Yes this step will solve this problem.

After addd platform iOS. In (your project)/platforms/ios/ Podfile must have pod 'GoogleMaps', '~> 2.7.0' line. And GoogleMaps in Pods folder

I try to update plugin in another project 2.4.4 -> 2.4.6 after first project work. it work fine

@iPMisterX Same here. I’ve been banging away at this all day and all of a sudden a removing of the iOS platform (for the 10th+ time today) and re-adding fixed the issue. Maybe an endpoint was down? Either way, resolved guys. TY for the support.

CocoaPods : 1.5.3

I guess I should just ask. Does anyone have this working on iOS 12 using Xcode 10 on Mojave? If it’s a yes then I can figure it out I’m sure.