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

Cordova 9 support #2581

Closed
4 of 5 tasks
nerumo opened this issue Mar 20, 2019 · 39 comments
Closed
4 of 5 tasks

Cordova 9 support #2581

nerumo opened this issue Mar 20, 2019 · 39 comments

Comments

@nerumo
Copy link

nerumo commented Mar 20, 2019

I'm submitting a ...

  • question
  • any problem or bug report

OS: (check one with "x")

  • Android
  • iOS
  • Browser

The comming cordova 9 version will drop the support for requireCordovaModule calls in the hooks.

Example error message with the latest nightlies from cordova:

Failed to install 'cordova-plugin-googlemaps': CordovaError: Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
@wf9a5m75
Copy link
Member

I see. I will test it later. Thank you for letting me know.

wf9a5m75 added a commit that referenced this issue Mar 20, 2019
@wf9a5m75
Copy link
Member

Please try to install from the multiple_maps branch.

@hartherbert
Copy link
Contributor

I had to downgrade to cordova@8.1.2 to make it work on my system. Support for cordova 9 is pretty important.

@wf9a5m75
Copy link
Member

As I said above, please use the multiple_maps branch.

@nerumo
Copy link
Author

nerumo commented Mar 23, 2019

I can confirm, the multiple_maps branch works. I'm actually not using the multiple_branchs branch, I use the published npm package. Is there a plan to make a npm release of this branch? Are there breaking changes?

@nerumo
Copy link
Author

nerumo commented Mar 23, 2019

Ah sorry, too early: ios install still failes because of check_sdk_version.js

@wf9a5m75
Copy link
Member

Please report with error log, not just Ah sorry, too early: ios install still failes because of check_sdk_version.js.

@nerumo
Copy link
Author

nerumo commented Mar 24, 2019

Sorry, I don't have the call stack right now, but I can point you to the error.
In https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/multiple_maps/src/ios/check_sdk_version.js

On line 3, 5 and 6 there are usages of the removed requireCordovaModule method.

@bugsmafia
Copy link

bugsmafia commented Mar 27, 2019

Give instructions on how to install the plugin on Cordova 9.0 and Android 8.0

PS C:\Project\app> cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID="*****" --variable API_KEY_FOR_IOS="*****" Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

npm --v 6.9.0 node -v v9.8.0

@Ionys320
Copy link

Hello,
I have the same problem and use the multiple_maps doesn't work. What can I do ?

@wf9a5m75
Copy link
Member

PR is merged to the multiple_maps branch.

@mariusbolik
Copy link
Member

What's with line 3? In the PR there is still the requireCordovaModule() present! Shouldn't this be replaced, too?

@wf9a5m75
Copy link
Member

No. requireCordovaModule("q") is only deprecated. Please try by yourself before asking.

@nerumo
Copy link
Author

nerumo commented Mar 29, 2019

IMHO @mariusbolik is right, that it should be replaced. but @wf9a5m75 is right too and the last PR solved the issue. Thank you.

Since working with git references is slowing the restore process quite a bit: is there a plan to make a npm release too?

@daninietoandres
Copy link

Hey i have the same problem with ionic cordova plugin add cordova-plugin-geolocation

@hartherbert
Copy link
Contributor

@mariusbolik on line 3 the command requireCordovaModule('cordova-common') is valid.
the requireCordovaModule is only deprecated for loading non-cordova modules.

@daninietoandres just use the master-branch of the cordova-plugin-geolocation via
npm i https://github.com/apache/cordova-plugin-geolocation.git

@mariusbolik
Copy link
Member

I don't really know if Google Maps is the issue, but with --livereload (Ionic) I get the following error:

@FGButterLettuce
Copy link

FGButterLettuce commented Apr 2, 2019

>cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=... --variable API_KEY_FOR_IOS=... --save
Installing "cordova-plugin-googlemaps" for android
Failed to install 'cordova-plugin-googlemaps': CordovaError: Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
    at Context.requireCordovaModule (/home/linuxbrew/.linuxbrew/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)
    at module.exports (/home/niranjan/APM App/Master/APMApplication/plugins/cordova-plugin-googlemaps/src/before_plugin_install.js:3:16)
    at runScriptViaModuleLoader (/home/linuxbrew/.linuxbrew/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
    at runScript (/home/linuxbrew/.linuxbrew/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
    at /home/linuxbrew/.linuxbrew/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
[ERROR] An error occurred while running subprocess cordova.

On attempting to use the multiple_maps branch, i get the same result

$ ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID="..." --variable API_KEY_FOR_IOS="..."

> cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID=... --variable API_KEY_FOR_IOS=... --save
Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
[ERROR] An error occurred while running subprocess cordova.

im running cordova 9.0.0, ionic 4.12.0 & npm 6.9.0

adamduren added a commit to adamduren/cordova-plugin-googlemaps that referenced this issue Apr 2, 2019
@adamduren adamduren mentioned this issue Apr 2, 2019
adamduren added a commit to adamduren/cordova-plugin-googlemaps that referenced this issue Apr 2, 2019
adamduren added a commit to adamduren/cordova-plugin-googlemaps that referenced this issue Apr 2, 2019
@mariusbolik
Copy link
Member

I don't really know if Google Maps is the issue, but with --livereload (Ionic) I get the following error:

I'm still getting this error using the plugin with ionic cordova run ios --livereload
Without --livereload it's working. If I uninstall this plugin --livereload is working again.

@adamduren @wf9a5m75

@adamduren
Copy link
Contributor

@mariusbolik I think this is unrelated to this issue / plugin. Try uninstalling cordova-plugin-googlemaps and remove references to the plugin. Try to rebuild and see if the problem still exists. If it does then I would suggest to create a separate issue for this repo.

@adamduren
Copy link
Contributor

@mariusbolik I actually just came across this issue when upgrading @ionic/build-angular to 1.5.0 try reverting to or installing 1.4.1. Hope this helps.

ionic-team/angular-toolkit#109

@wf9a5m75
Copy link
Member

wf9a5m75 commented Apr 3, 2019

@mariusbolik Please try the @adamduren's advice. If it does not work, please share your project files on Github repository. I will check it.

wf9a5m75 added a commit that referenced this issue Apr 4, 2019
@mariusbolik
Copy link
Member

@adamduren WOW! Thank you. This really was the solution! Everything works fine now.

@FGButterLettuce
Copy link

Update on the issue, simply downgrading to Cordova 8.1.0 worked for me as well, I believe downgrading angular would also do the trick

@thineikhaing
Copy link

thineikhaing commented Apr 10, 2019

I'm getting the issue
Screen Shot 2019-04-10 at 5 12 03 PM

"CordovaError: Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
"
in running cordova 9.0.0, android 8.0.0, and ios 5.0.0

@adamduren
Copy link
Contributor

@thineikhaing we're still waiting on @wf9a5m75 to release a new version I believe

@sudhirbitsgoa
Copy link

'cordova-plugin-googlemaps': CordovaError: Using "requireCordovaModule" to load non-cordova module'cordova-plugin-googlemaps': CordovaError: Using "requireCordovaModule" to load non-cordova module same here

@wf9a5m75
Copy link
Member

Use the multiple_maps branch

@adamduren
Copy link
Contributor

@wf9a5m75 when you create new releases are they from master or multiple_maps?

@luisgagocasas
Copy link

I solved it by changing the version of Cordova.

npm uninstall -g cordova
npm cache clean --force
npm i -g cordova@8.1.2

Of causality will they have any improvement for cordova 9?

@giothc94
Copy link

Muchas gracias @luisgagocasas Su respuesta soluciono mi problema

@wf9a5m75
Copy link
Member

cordova-plugin-googlemaps v2.6.0 has released.

@cloud27
Copy link

cloud27 commented Jul 14, 2019

Sorry but I have the problem with the 2.6.2

@Ilhamsafeek
Copy link

Ilhamsafeek commented Aug 15, 2019

trying with 'npm i' is worked for me.
npm i cordova-plugin-googlemaps@latest

@rolinger
Copy link

rolinger commented Aug 27, 2019

I am getting this issue for cordova-plugin-enable-multidex (v0.1.3). I just upgraded from cordova 8.0.0 to 9.0.0, added my cordova platform add android (all my plugins were already installed) and got the following error:

Installing "cordova-plugin-enable-multidex" for android
Subproject Path: CordovaLib
Subproject Path: app
Failed to install 'cordova-plugin-enable-multidex': CordovaError: Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use
egular "require" to load it.
at Context.requireCordovaModule (C:\Users\RPO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\Context.js:57:15)
at module.exports (c:\Users\RPO\dev\myApp\plugins\cordova-plugin-enable-multidex\scripts\android\editManifest.js:2:22)
at runScriptViaModuleLoader (C:\Users\RPO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:181:32)
at runScript (C:\Users\RPO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:157:16)
at C:\Users\RPO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:125:20
at process._tickCallback (internal/process/next_tick.js:109:7)
Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

@Lutherwaves
Copy link

Lutherwaves commented Oct 4, 2019

I am also currently experiencing the following issue on IOS when using Cordova 9, when trying to build my app:

Installing "cordova-plugin-googlemaps" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, which conflicts with another plugin. GoogleMaps@~> 3.1.0 is already installed and was not overwritten.
Running command: pod install --verbose
Failed to install 'cordova-plugin-googlemaps': Error: pod: Command failed with exit code 1
    at ChildProcess.whenDone (/Users/ps-wt/Conf-App/conference-app/node_modules/cordova-common/src/superspawn.js:135:23)
    at ChildProcess.emit (events.js:209:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
Failed to restore plugin "cordova-plugin-googlemaps" from config.xml. You might need to try adding it again. Error: Error: pod: Command failed with exit code 1

My Ionic Info:

 Ionic:

   Ionic CLI                     : 5.4.0 (/Users/ps-wt/.nvm/versions/node/v12.9.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.8.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 19 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.7.0)
   native-run  : 0.2.8

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.2
   NodeJS     : v12.9.0 (/Users/ps-wt/.nvm/versions/node/v12.9.0/bin/node)
   npm        : 6.10.2
   OS         : macOS Mojave
   Xcode      : Xcode 11.0 Build version 11A420a 

My plugins:

com-sarriaroman-photoviewer 1.2.2 "PhotoViewer"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-advanced-http 2.0.5 "Advanced HTTP plugin"
cordova-plugin-colored-browser-tabs 1.0.0 "cordova-plugin-colored-browser-tabs"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
cordova-plugin-fcm-with-dependecy-updated 3.2.0 "Cordova FCM Push Plugin"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.2.0 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-googlemaps 2.6.3-20190930-1257 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-sqlite-storage 3.1.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova-support-google-services 1.3.1 "cordova-support-google-services"
integrator-cordova-plugin-downloader 0.0.1 "Downloader"
ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"

However, when I downgrade to Cordova 8.1.2 the application crashes and I get an error alert on the iPhone (on the device, not in Xcode) when launching the app: The Google Maps SDK for iOS crashes, when CFBundleExecutable contains Latin Characters Check CordovaGoogleMaps.m for more information. After entering the maps page once, the whole app crashes and is rendered unusable.

I am using the multiple_maps branch like suggested here and would really appreciate any insights regarding this issue. If needed, I can create a new one. I have also followed the guide on https://ionic.zendesk.com/hc/en-us/articles/360009643533-iOS-Builds-fail-to-install-cordova-plugin-googlemaps-, which does not change anything in my case.

@wf9a5m75
Copy link
Member

wf9a5m75 commented Oct 4, 2019

First of all, please read this thread, and please please please post formatted text.
#2661


The Google Maps SDK for iOS crashes, when CFBundleExecutable contains Latin Characters Check CordovaGoogleMaps.m for more information.

Then did you check CordovaGoogleMaps.m?


cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, which conflicts with another plugin. GoogleMaps@~> 3.1.0 is already installed and was not overwritten.

Please search this warning message before posting.

And I think your cocoapod is old or too much latest.

@Lutherwaves
Copy link

First of all, please read this thread, and please please please post formatted text.
#2661

I am really sorry that I hadn't followed the guidelines and appreciate that you managed to take a look at it anyways!

The Google Maps SDK for iOS crashes, when CFBundleExecutable contains Latin Characters Check CordovaGoogleMaps.m for more information.

Then did you check CordovaGoogleMaps.m?

cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, which conflicts with another plugin. GoogleMaps@~> 3.1.0 is already installed and was not overwritten.

Please search this warning message before posting.

I will check it out as soon as I can and get back to you!

And I think your cocoapod is old or too much latest.

My CocoaPods version:

1.8.1
``

@wf9a5m75
Copy link
Member

wf9a5m75 commented Oct 7, 2019

For crying out loud, please find the past log.

#2612 (comment)

@wf9a5m75 wf9a5m75 unpinned this issue Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests