Cordova error: Failed to fetch plugin

I just successfully updated an old Meteor 1.6.x app to Meteor 1.10.2. This app uses Meteor packages that reference Cordova packages via Cordova.depends. The packages are on Github, so I reference them with a Github URL:

Cordova.depends({
  "com.concats.cordova-plist-patches": "https://github.com/concats/cordova-plist-patches/tarball/bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2"
});

According to the Meteor docs, this should still work:

However, if I try to run the app on my iPhone, the build crashes with this error message:

 While adding plugin https://github.com/concats/cordova-plist-patches.git#bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2
   to Cordova project:
   Cordova error: Failed to fetch plugin                                           
   https://github.com/concats/cordova-plist-patches.git#bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2 via registry.
   Probably this is either a connection problem, or plugin spec is incorrect.

The commit link seems to be valid, but still… What is interesting here is that the /tarball part of the URL has been dropped.

I tried to set the URL to this link instead:

https://github.com/concats/cordova-plist-patches#bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2

but this resulted in this error:

Meteor no longer supports installing Cordova plugins from arbitrary tarball URLs. You can either add a
   plugin from a Git URL with a SHA reference, or from a local path. (Attempting to install from
   https://github.com/concats/cordova-plist-patches#bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2

which is funny because the docs tell you otherwise. At least it is unclear to me what an “non-arbitrary tarball URL” should be?

Also, adding .git to the link does not work

https://github.com/concats/cordova-plist-patches.git#bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2```

In this case, I get the fetch error again. Where exactly can I find the documentation how a “Git URL with a SHA reference” has to look like?

1 Like

Update, as a reference for others.

The only workaround I found so far:

  • Add the Cordova plugins as sub-modules to my project. I’m using the /imports folder for this, assuming it won’t be packaged unless the files are referenced from the project, which would be the case for the /private folder.
  • Reference the plugins in .meteor/cordova-plugins directly, as file URLs:
    cordova-my-plugin@file://./imports/cordova/cordova-my-plugin

This lowers the modularity benefits you have with Meteor packages, but at least it works.

1 Like