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
nerumo opened this issue Mar 20, 2019 · 33 comments

Comments

Projects
None yet
@nerumo
Copy link

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

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

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

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

Please try to install from the multiple_maps branch.

@hobbydevs

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2019

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

@wf9a5m75

This comment has been minimized.

Copy link
Member

commented Mar 23, 2019

As I said above, please use the multiple_maps branch.

@nerumo

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented Mar 23, 2019

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

@wf9a5m75

This comment has been minimized.

Copy link
Member

commented Mar 23, 2019

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

@nerumo

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

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

@KyllianDM

This comment has been minimized.

Copy link

commented Mar 27, 2019

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

@wf9a5m75

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

PR is merged to the multiple_maps branch.

@mariusbolik

This comment has been minimized.

Copy link

commented Mar 29, 2019

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

@wf9a5m75

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

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

@nerumo

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

commented Mar 30, 2019

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

@hobbydevs

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

@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

This comment has been minimized.

Copy link

commented Apr 1, 2019

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

@FGButterLettuce

This comment has been minimized.

Copy link

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 referenced this issue Apr 2, 2019

Closed

Fixes #2581 #2590

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

This comment has been minimized.

Copy link

commented Apr 3, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

@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

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

@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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Apr 5, 2019

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

@FGButterLettuce

This comment has been minimized.

Copy link

commented Apr 6, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2019

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

@sudhirbitsgoa

This comment has been minimized.

Copy link

commented Apr 12, 2019

'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

This comment has been minimized.

Copy link
Member

commented Apr 12, 2019

Use the multiple_maps branch

@adamduren

This comment has been minimized.

Copy link
Contributor

commented Apr 12, 2019

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

@luisgagocasas

This comment has been minimized.

Copy link

commented Apr 15, 2019

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

This comment has been minimized.

Copy link

commented Apr 15, 2019

Muchas gracias @luisgagocasas Su respuesta soluciono mi problema

@wf9a5m75

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

cordova-plugin-googlemaps v2.6.0 has released.

@cloud27

This comment has been minimized.

Copy link

commented Jul 14, 2019

Sorry but I have the problem with the 2.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.