Ionic 5 Capacitor + CordovaGoogleMaps = "MainViewController.h file not found" Build Error

I am upgrading from Ionic 4 w/Cordova to Ionic 5 w/Capacitor, and during the upgrade, I began receiving the following error on every IoS build (haven’t tested Android yet):

Here are my dependancies { "@agm/core": "^3.0.0-beta.0", "@angular/common": "~10.0.0", "@angular/core": "~10.0.0", "@angular/forms": "~10.0.0", "@angular/platform-browser": "~10.0.0", "@angular/platform-browser-dynamic": "~10.0.0", "@angular/router": "~10.0.0", "@capacitor/android": "^2.4.1", "@capacitor/core": "2.4.1", "@capacitor/ios": "^2.4.1", "@ionic-native/core": "^5.22.0-beta-1", "@ionic-native/geolocation": "^5.28.0", "@ionic-native/google-maps": "^5.27.0-beta-20200630", "@ionic-native/native-storage": "^5.28.0", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/status-bar": "^5.0.0", "@ionic/angular": "^5.0.0", "@ionic/storage": "^2.3.1", "cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-googlemaps": "^2.7.1", "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git", "cordova-plugin-nativestorage": "^2.3.2", "ngx-mask-ionic": "^1.1.2", "rxjs": "~6.5.5", "tslib": "^2.0.0", "zone.js": "~0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1000.0", "@angular/cli": "~10.0.5", "@angular/compiler": "~10.0.0", "@angular/compiler-cli": "~10.0.0", "@angular/language-service": "~10.0.0", "@capacitor/cli": "2.4.1", "@ionic/angular-toolkit": "^2.3.0", "@types/googlemaps": "^3.39.13", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~3.9.5" }

I can supply any other information upon request. Thank you for your time!

I see a lot of “beta” in there. Can you see if this problem persists using only release versions of everything?

@rapropos Same error, even after reverting to the most recent non-beta release of all packages :confused:

In file included from /Users/haevenkelley/Sites/jacobsSWAG/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginGooglemaps/PluginViewController.m:9:
In file included from /Users/haevenkelley/Sites/jacobsSWAG/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginGooglemaps/PluginStreetViewPanoramaController.h:12:
/Users/haevenkelley/Sites/jacobsSWAG/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginGooglemaps/PluginUtil.h:14:9: fatal error: ‘MainViewController.h’ file not found
#import “MainViewController.h”
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command CompileC failed with a nonzero exit code

The Google Maps Plugin is not ready to work on Capacitor on iOS.

See here the List of known incompatible Plugins

BUT: Ionic official supports this project and paid the author:

Issue in Plugin Repo (with fundraising): https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/2781

1 Like