cordova-plugin-code-push icon indicating copy to clipboard operation
cordova-plugin-code-push copied to clipboard

Failed to install cordova-plugin-zip

Open gplancke opened this issue 8 years ago • 6 comments

Description

When installing the code-push-plugin, the plugin cordova-plugin-zip is failing to install. While this is probably a plugin with the latter itself, recently you introduced a time-bomb in the way you handled your dependencies.

More precisely here: https://github.com/Microsoft/cordova-plugin-code-push/commit/131c19aab3563cfd3485fdc1114ff00acc84bc62#diff-fa9df665d596e24b8613353a038390c9R42

Without specifying a version there, you introduce a dependency on the "well being" of the master branch of the targeted plugin.

Furthermore, I can understand why you had to make a custom post-install script for the file-transfer plugin (and remove it from the dependency list in the plugin.xml file), but not really why you included the zip plugin here too. Looks like it was more comfortable in its previous location (aka: the plugin.xml file)

Reproduction

  1. Remove all platforms (to start fresh)
  2. Install the code-push plugin
  3. Add the android platform

=> Failed to install cordova-plugin-zip

Additional Information

  • cordova-plugin-code-push version: latest (but introduced in 1.11.0)
  • Cordova version: 7.1.0

gplancke avatar Jan 19 '18 16:01 gplancke

Hi @gplancke, thanks for reaching us. Can you please specify what exactly fails when installing cordova-plugin-zip? I have just tried to reproduce your issue and everything seems to be working for me.

Let me explain why we had to handle this dependency in a script. Zip plugin, though seems to be unrelated to file and file-transfer plugins, has in its plugin.xml a cordova-file-plugin dependency, too. So if we place cordova-zip-plugin in our plugin.xml, it ends up installing cordova-plugin-file dependent on the version specified in a cordova-plugin-zip config, which we don't want to happen.

Though I haven't managed to reproduce your issue, I assume that the problem you see is that cordova-plugin-zip might introduce a new version which requires a higher version of the file plugin and it would break the script and don't let the code-push plugin install.

What I'd suggest to do is surround the installation of zip plugin with try..catch, as it has done above, and, in case of failure, install the stable version of zip plugin. Correct me if I'm wrong. If my solution suits you, we will release it with next version of the plugin.

annakocheshkova avatar Jan 22 '18 10:01 annakocheshkova

Hi @annakocheshkova,

Thanks for the clarification.

About my problem, sorry, but I had to move on to other matters, so I can't really give you an exact output of what failed exactly ATM. But from what I remember, I think it was due to the fact that some plugins don't play well with the default 'use fetch' in cordova (on some configurations).

In fact this is another problem with installing a plugin in a script, it does not take into account options normally passed to cordova plugin add command.

If what I remember is correct, your solution won't fix it, but in any case, a fail safe would not hurt !

I'll try to come back to you ASAP with more info, but can't promise you something short term.

Thanks anyway for taking this seriously. Keep doing a good job !

gplancke avatar Jan 23 '18 10:01 gplancke

@gplancke, thank you for your answer. We surely will add a fallback for zip plugin. If you encounter this problem once again, please provide us the exact output when the installation fails. I'm closing this for now, feel free to re-open if you have any updates or information.

annakocheshkova avatar Jan 23 '18 11:01 annakocheshkova

Reopening, will close when add the fallback.

annakocheshkova avatar Jan 23 '18 11:01 annakocheshkova

I've had all sorts of issues trying to install the CodePush plugin with the latest Cordova, but none of them seem possible to resolve at the plugin level, they're all at the cordova-fetch module: https://issues.apache.org/jira/browse/CB-13797

dpogue avatar Jan 23 '18 20:01 dpogue

Have added the fallback, closing this for now.

annakocheshkova avatar Jan 25 '18 15:01 annakocheshkova