1

I've installed the visual studio extension Multi-device hybrid, all is fine except when I run a new project with any of the the Cordova plugins enabled e.g. battery-status. I'm getting the error message below. But if I remove or disabled all the plugins it is working ok. Is anyone had an idea about the error dumps below or had experienced the same problem before? Thanks.

Error Message

Failed to fetch package information for org.apache.cordova.battery-status C:\Mobile\CordovaApp\CordovaApp\EXEC 1 1 CordovaApp

Visual Studio Output

------ Adding plugin: org.apache.cordova.battery-status
1>  Calling plugman.fetch on plugin "org.apache.cordova.battery-status"
1>  
1>  C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>EXEC : error : Failed to fetch package information for org.apache.cordova.battery-status
1>      at C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\src\plugman\registry\registry.js:32:20
1>      at Request.cb [as _callback] (C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\src\plugman\registry\registry.js:251:9)
1>      at self.callback (C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\node_modules\request\index.js:148:22)
1>      at Request.emit (events.js:117:20)
1>      at ClientRequest.self.clientErrorHandler (C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\node_modules\request\index.js:257:10)
1>      at ClientRequest.emit (events.js:95:17)
1>      at Socket.socketErrorListener (http.js:1551:9)
1>      at Socket.emit (events.js:95:17)
1>      at net.js:440:14
1>      at process._tickCallback (node.js:419:13)
1>C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets(99,5): error MSB3073: The command ""C:\Users\myuser\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "CordovaApp" --language "en-US" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 8.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
allan
  • 131
  • 10

2 Answers2

0

I found a work-around by downloading the plugin itself and adding the folders into my project. First create a new folder called 'plugins' under your root project folder then copy the downloaded plugin (C:\myfile\cordova\plugins\org.apache.cordova.battery-status) under the plugins folder of your project. Build.

allan
  • 131
  • 10
  • Plugman might fail if you are behind a corporate proxy that is preventing it from downloading the plugins. I was wondering if you knew that was the case? – Priyank Nov 05 '14 at 06:46
  • Yes, I knew that could be the case as I am doing it at work, thanks. I just don't know how to set Plugman so that it could go through the corporate proxy. I was able to set it up in npm but don't know where or how to set it up for Plugman. – allan Nov 05 '14 at 23:15
0

For set proxy settings on Plugman you must have to create a "config" file (without extension) in the C:\Users\ -youruser-\ .plugman folder, because plugman cant get itself npm proxy settings.

This config file are identical to .npmrc file of npm config:

proxy = http://username:passwords@proxyaddress:port#
https-proxy = http://username:passwords@proxyaddress:port#

Another way for set proxy is via console with:

plugman config set proxy http://username:passwords@proxyaddress:port#

This issue is tracked in jira for plugman. There is no way to set a proxy for plugman

Frix33
  • 1,231
  • 10
  • 27