cordova-plugin-googlemaps: installation freezes whiling adding to iOS platform

Screen Shot 2020-04-12 at 8 19 31 PM **I'm submitting a ...** (check one with "x") - [ ] question - [x] any problem or bug report

OS: (check one with “x”)

  • Android
  • iOS
  • Browser

cordova information: (run $> cordova plugin list)

branch-cordova-sdk 4.1.2 "branch-cordova-sdk"
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-plugin-android-permissions 1.0.2 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-mode 0.7.3 "BackgroundMode"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-facebook4 6.4.0 "Facebook Connect"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-sms-retriever-manager 0.0.1 "Device"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova.plugins.diagnostic 5.0.1 "Diagnostic"
ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"
onesignal-cordova-plugin 2.8.4 "OneSignal Push Notifications"

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:

When I add cordova-plugin-googlemaps to my project that have Android & iOS platform, it installs normally to android but it freezes for ios when reaching Installing “cordova-plugin-googlemaps” for ios.

If I use --verbose, I found that it stops while installing the SDK from github by running the following command: npm install https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk --production --save-exact

It’s the first time I face such issue with cordova-plugin-googlemaps.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

git clone git@github.com:mapsplugin/cordova-plugin-googlemaps-sdk.git

cd (path to)/project dir/

cordova plugin install (path to)/cordova-plugin-googlemaps-sdk

cordova plugin install cordova-plugin-googlemaps

Tarball install is probably broken: https://github.com/apache/cordova-cli/issues/452

Unfortunately i do not have any other ideas either. For my use case, i solved the slow checkout by automatically changing the plugin.xml back to the CocoaPod way. I do that by preinstalling cordova-plugin-googlemaps at npm install phase of my project (as devDependency), then i automatically patch plugin.xml of cordova-plugin-googlemaps in node_modules before i do any cordova commands. But that is not an universal solution for everyone.

Technically the installation is not freezing, the git checkout is stuck on git index-pack subcommand for long time.

Because the dependency is a git URL (https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk) the npm install command does a full git clone of the repository - which includes binary files for every version published in the repository. Also because it is a git dependency, there is no caching of the repository in .npm cache, so it checks out the whole repository on every clean build.

The binary files are big (tens of MB) and because of that git clone must transfer lot of data, right now it is a 558.53 MiB repository (or to be more specific, the file in .git/objects/pack).

Ideally every version of SDK should be published on NPM, thus dropping the install size down to the actual size of the framework file (currently around 45MB), but i am not sure how long is that acceptable (in NPM discussion from 2016, they disliked packages bigger than 20MB, but said that up to 120MB is possible ).

Alternatively cordova-plugin-googlemaps-sdk could use GIT LFS (thus cutting out the binary files from actual GIT repository checkout, as git would only check out the repository without the binary files, then grab the binary files corresponding to the checked out branch) or as a final alternative, use a hook to grab the binary files instead of hosting them in the repository.

I tried to reinstall it today and it works as expected without any issue.