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.plugins is undefined! #451

Open
EmilAways opened this issue Jun 1, 2019 · 15 comments
Open

cordova.plugins is undefined! #451

EmilAways opened this issue Jun 1, 2019 · 15 comments

Comments

@EmilAways
Copy link

I installed the plugin through the command line, and it's visible in the plugins-list when running the cmd cordova plugins but in javascript cordova.plugins is undefined and so is ofcourse cordova.plugin.backgroundMode! I tried checking the existence of cordova.plugins.backgroundMode after deviceready and manually through eval minutes after load on real device, and it's nothing there.

@jrcichra
Copy link

jrcichra commented Jun 1, 2019

Having the same issue

1 similar comment
@Nagasakie
Copy link

Having the same issue

@tobika
Copy link

tobika commented Jun 3, 2019

Hi, did you install the plugin from the git repo? because the npm version is quite outdated?
Also did you have errors in the terminal while adding the plugin?
cordova plugin add https://github.com/katzer/cordova-plugin-background-mode.git

@Nagasakie
Copy link

Nagasakie commented Jun 3, 2019

My terminal only prints:
Installing "cordova-plugin-background-mode" for browser
warn

But the plugin seems to be installed

@tobika
Copy link

tobika commented Jun 3, 2019

@Nagasakie just to confirm, do you use this plugin for android/ios?

Maybe your terminal output is not complete but I see "for browser" there and this plugin is only used for native platforms, not in the browser. If you test your ionic/cordova app in the browser it is normal that cordova.plugins is undefined

@Nagasakie
Copy link

@tobika yes, I use this plugin for android and I have the same issue.

@tobika
Copy link

tobika commented Jun 3, 2019

@Nagasakie could you please uninstall and reinstall the plugin and post the whole terminal output here? Otherwise it will be difficult to help.

@Nagasakie
Copy link

image
As you can see @tobika, the only terminal output i have without --verbose is what i wrote some comments before.

@tobika
Copy link

tobika commented Jun 3, 2019

@Nagasakie thanks, do you use cordova 9?
This seems to be maybe the same issue someone resolved here:
#441 (comment)

@Nagasakie
Copy link

@tobika yes, i use cordova 9.0.0 (cordova-lib@9.0.1).
Thanks, I tried it but it does not work.

@YEMEAC
Copy link

YEMEAC commented Jun 7, 2019

having the same issue cordova backgroun modes undefined. When i install the plugin i get:
cordova plugin add cordova-plugin-background-mode
Installing "cordova-plugin-background-mode" for android
warn

@spacehunter
Copy link

same here...

cordova plugin add https://github.com/katzer/cordova-plugin-background-mode.git
Installing "cordova-plugin-background-mode" for android
warn

Is there a fix?

@jrcichra
Copy link

jrcichra commented Jul 9, 2019

See if my solution helps any: https://stackoverflow.com/questions/56414678/cordova-app-that-uploads-my-location-every-minute-to-a-back-end-server-even-whe

@jrcichra
Copy link

jrcichra commented Jul 9, 2019

It might be because I downgraded to 9.0.0. That worked seemed to work for me.

@zowpro
Copy link

zowpro commented Aug 13, 2019

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

7 participants