cordova-plugin-background-mode icon indicating copy to clipboard operation
cordova-plugin-background-mode copied to clipboard

Can't install plugin on cordova 9

Open reitererm opened this issue 5 years ago • 38 comments

Hi!

I can't install this plugin on a cordova 9.0.0 project. I just can see the start of a warning:

E:\Cordova9>cordova -v 9.0.0

E:\Cordova9>cordova plugin add cordova-plugin-background-mode Installing "cordova-plugin-background-mode" for android warn

E:\Cordova9>

Best regards Michael

reitererm avatar Mar 27 '19 13:03 reitererm

I was also having the same issue. The plugin does appear on the list when I do "cordova plugins". That is probably the reason why I'm having "Uncaught TypeError: Cannot read property 'backgroundMode' of undefined".

reymonreyes avatar Mar 27 '19 13:03 reymonreyes

We are having the same problem...

C:\Projects\pp\test>ionic cordova plugin add cordova-plugin-background-mode

cordova plugin add cordova-plugin-background-mode --save Installing "cordova-plugin-background-mode" for android warn

C:\Projects\pp\test>

Rindegastos avatar Mar 28 '19 13:03 Rindegastos

same problem for ios

xam8re avatar Mar 30 '19 16:03 xam8re

I have some probem too.

strike56 avatar Apr 02 '19 05:04 strike56

Yeah got the same problem when trying to re-add the plugin - (the src etc doesn't get added). I had a copy of the plugin on my machine which works well - so a workaround could be to manually download the plugin off the git and add from your local machine?

f18nfz avatar Apr 02 '19 13:04 f18nfz

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

nnez avatar Apr 04 '19 10:04 nnez

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

But I have the same issue in Mac OS.

Installing "cordova-plugin-background-mode" for android warn CordovaError: warn at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:230:23 at Array.forEach (<anonymous>) at getEngines (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:208:13) at Function.runInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:285:22) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:76:35 at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:757:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

bauyrzhanospan avatar Apr 04 '19 13:04 bauyrzhanospan

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

Confirmed! For Android.

strike56 avatar Apr 04 '19 18:04 strike56

For me, I had to change the plugin.xml and change <source-file src="src/android/BackgroundModeExt.java" target-dir="src/de/appplant/cordova/plugin/background" /> to <source-file src="src/android/BackgroundExt.java" target-dir="src/de/appplant/cordova/plugin/background" />

lonelyls avatar Apr 05 '19 05:04 lonelyls

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

aparently work here

jeanlandim avatar Apr 08 '19 00:04 jeanlandim

Not working for me. ¿Can you fix that bug? Thank you very much.

ghost avatar Apr 08 '19 09:04 ghost

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

Thanks Works!

samsagaz avatar Apr 09 '19 02:04 samsagaz

I tried it but it does not work

ghost avatar Apr 09 '19 08:04 ghost

Deleting the line below works, as others said. The rest of the windows code is commented out. <engine name="windows-sdk" version=">=10.0.14393.0" />

philipjbrowning avatar Apr 11 '19 22:04 philipjbrowning

For me, I had to change the plugin.xml and change <source-file src="src/android/BackgroundModeExt.java" target-dir="src/de/appplant/cordova/plugin/background" /> to <source-file src="src/android/BackgroundExt.java" target-dir="src/de/appplant/cordova/plugin/background" />

this file "BackgroundExt.java" not exist in 0.7.2 version. any alternative fix?

iomJvaranam avatar Apr 12 '19 10:04 iomJvaranam

For me, I had to change the plugin.xml and change <source-file src="src/android/BackgroundModeExt.java" target-dir="src/de/appplant/cordova/plugin/background" /> to <source-file src="src/android/BackgroundExt.java" target-dir="src/de/appplant/cordova/plugin/background" />

this file "BackgroundExt.java" not exist in 0.7.2 version. any alternative fix?

my fork fix cordova 9

https://github.com/sercatven/cordova-plugin-background-mode

sercatven avatar Apr 12 '19 11:04 sercatven

How can I install de plugin without de Cordova-CLI so I can delete the indicated windows line of code?

Rindegastos avatar Apr 15 '19 22:04 Rindegastos

For me, IONIC 4

  • run: cordova plugin add cordova-plugin-background-mode normal
  • $root_dir/plugins/cordova-plugin-background-mode/plugin.xml delete line <engine name="windows-sdk" version=">=10.0.14393.0" />
  • run: ionic cordova platform rm android ; ionic cordova platform add android
  • done

hungtranqn avatar Apr 18 '19 03:04 hungtranqn

Same issue here, seems to be related to the windows-sdk line on plugin.xml.

Can someone fix it?

iget-master avatar Apr 27 '19 14:04 iget-master

@sercatven : still facing same issue for Background Mode plugin not installed error

SanjanaTailor avatar May 03 '19 05:05 SanjanaTailor

For me, IONIC 4

  • run: cordova plugin add cordova-plugin-background-mode normal
  • $root_dir/plugins/cordova-plugin-background-mode/plugin.xml delete line <engine name="windows-sdk" version=">=10.0.14393.0" />
  • run: ionic cordova platform rm android ; ionic cordova platform add android
  • done

Does it work for ios too?

inDivyanshu avatar May 03 '19 08:05 inDivyanshu

@Divyanshu30 : I am using ionic3. I also delete the line in plugin.xml but when I say this.backgroundMode.on('Activate') error showing for me Plugin not installed

SanjanaTailor avatar May 03 '19 09:05 SanjanaTailor

@All : I uninstall cordova version 9.0 and tried to install cordova version 8 and installed plugin called Background Mode and no error shown and working fine

SanjanaTailor avatar May 12 '19 09:05 SanjanaTailor

I have the same problem with Cordova 9 & iOS. I'm waiting for the solution. I hope it arrives early because I can't release the app.

aperrone avatar May 16 '19 12:05 aperrone

It is going to be almost 2 months since this error appearded. Is there a way to fix it? I think the pull requests are still waiting there.

Rindegastos avatar May 16 '19 16:05 Rindegastos

Hey everyone! I'm too face this problem when trying to install this plugin in Cordova 9.0.0. However, I just found a way to make it work despite I don't know why doing this make this work.

Just delete the following line in plugin.xml <engine name="windows-sdk" version=">=10.0.14393.0" />

works for me! Thanks

tonnymedina avatar May 16 '19 16:05 tonnymedina

It works but only on iphone simulator; not on real device!

aperrone avatar May 17 '19 10:05 aperrone

It works but only on iphone simulator; not on real device!

that just happened to me. please help

tonnymedina avatar May 17 '19 12:05 tonnymedina

For me, I had to change the plugin.xml and change <source-file src="src/android/BackgroundModeExt.java" target-dir="src/de/appplant/cordova/plugin/background" /> to <source-file src="src/android/BackgroundExt.java" target-dir="src/de/appplant/cordova/plugin/background" />

this file "BackgroundExt.java" not exist in 0.7.2 version. any alternative fix?

my fork fix cordova 9

https://github.com/sercatven/cordova-plugin-background-mode

This fork worked for me. My environment is Ionic 4 and Android 9.0. Also note that you need to call disableWebviewOptmizations for your app to actually keep running on background. Thanks @sercatven . Also, please @katzer , accept the PR's to fix these bugs.

falquinho avatar May 22 '19 19:05 falquinho

#452

mikenetcode avatar Jun 06 '19 07:06 mikenetcode