0

I have a local plugin, which I'm trying to install to a Cordova project. Adding it through VS works like a charm, but when I'm building it, plugman tries to retrieve the plugin from the registry (npm http GET http://registry.cordova.io/[Plugin]/[Version]) and the build fails, because this plugin only exist locally.

Anyone got clue, how to make plugman fetch the plugin from the local path?

  • Is the plugin being fetched the same plugin or a different one? Plugins can have dependencies between one another referenced in the "plugin.xml" file. Can you include a log? – Chuck Lantz Jun 17 '15 at 23:03
  • It's the same plugin. Seems like VS 2015 ignores the fetch.json file. "com.transistorsoft.cordova.background-geolocation": { "source": { "type": "local", "path": "C:\\Code\\cordova-background-geolocation-edge" } } – Claus Nielsen Jun 18 '15 at 06:17
  • Apperently I need cordova cli >= 5.0.0. And VS 2015 cannot build that for android. Steps to reproduce: New Apache Cordova project Change Cordova Cli to 5.0.0 Build for Android Emulator Build fails, output: MDAVSCLI : error : C:\Code\Testing123\Testing123\platforms\android\cordova\build.bat: Command failed with exit code 2. – Claus Nielsen Jun 18 '15 at 06:46
  • When I build the same blank project with cli 5.0.0 for ripple it works. – Claus Nielsen Jun 18 '15 at 06:50
  • See the answer below - there's a link that should help explain what you're hitting and how to work around it if you want to stay on Cordova 4.3.1. I'd use Cordova 5.1.1 instead of 5.0.0 due to bugs that 5.0.0 has (including a security issue) that the community resolved in 5.1.1. – Chuck Lantz Jun 18 '15 at 15:04

1 Answers1

0

A significant changed that occurred with Cordova 5.0.0 is that plugins are now starting to move to npm. Unfortunately Cordova 4.3.1 and below do not support npm based plugins.

As a result, what you may be running into is this situation where the plugin references something in npm. This article has tips and workarounds for dealing with this problem when using Cordova 4.3.1 or below.

Note that you can use Cordova 5.0.0+ with Visual Studio 2015, but 5.0.0 has a known problem with Ripple along with an Android security issue that has been resolved in Cordova 5.1.1. I'd use Cordova 5.1.1 instead of 5.0.0. Note that VS will still build with Ant instead of Gradle in 2015 RC and some plugins may require Gradle. (This will be resolved in an upcoming update.)

Chuck Lantz
  • 1,440
  • 1
  • 8
  • 10