2

This is regarding Cordova based universal app development using Visual Studio 2015 - Tools for Apache Cordova (TACo).

Here is the sample code which I am trying to run: AngularJSToDo app. In this app, there is GeoLocation Cordova plugin is being used. In config.xml:

<vs:plugin name="org.apache.cordova.geolocation" version="0.3.10" />

While building application for Windows Phone Emulator 8.1, it throws an error after below process:

------ Adding plugin: cordova-plugin-geolocation@2.2.0

1> Calling plugman.fetch on plugin "cordova-plugin-geolocation@2.2.0"

1> Fetching plugin "cordova-plugin-geolocation@2.2.0" via plugin registry

1>MDAVSCLI : error : read ECONNRESET

This error appears after a long time fetching event. I have already tried installing particular plugin using "npm" command through command prompt, but VS build automatically clears older plugins and re-download and install latest ones.

In error section, it says

"read ECONNRESET"

Please guide me what should be done to resolve this error from Visual Studio build.

Reference: https://taco.visualstudio.com/en-us/docs/create-a-hosted-app/

Community
  • 1
  • 1
Mrunal
  • 13,982
  • 6
  • 52
  • 96
  • Its possible connection reset issue I believe. Are you behind firewall? – Gandhi May 27 '16 at 14:02
  • @Gandhi Yes, what should I do to run the same while firewall is ON, any way? – Mrunal May 30 '16 at 05:47
  • Try update the cordova CLI Version. – Elvis Xia - MSFT May 30 '16 at 07:21
  • @Mrunal you may have to check with your IT department to unblock those sites or else you gotta download the plugin manually and set it up – Gandhi May 30 '16 at 09:28
  • Try create a new vanilla apache cordova application. Build it, run it, to see if your environment is set up correctly. Then start adding plugins and code, 1 at a time to see what breaks the build. I ended up re-creating my project to get it working finally. – Quintonn Jun 01 '16 at 10:12

2 Answers2

1

Your plugin add is failing because Cordova has closed the Plugin registry and moved to npm. That means all Cordova versions less than 5.x which don't use npm will no longer be able to add plugins.

If you are not on the latest version of TACO, update to make sure that you are on a version that can add a plugin from npm

Then, instructions after updating:

  1. Go to config.xml -> plugins
  2. remove the camera plugin
  3. Add it back in again from the core plugin list

Actually I just ran the sample myself, and had no problem getting it to load on the iOS simulator, but it pulled the plugin from npm and not the plugin registry.

  • 1> Calling plugman.fetch on plugin "cordova-plugin-geolocation@2.2.0" 1> Fetching plugin "cordova-plugin-geolocation@2.2.0" via npm – Linda Zhong Jun 09 '16 at 00:07
  • Also, the AngularJS ToDo list sample has been updated with fixes after you downloaded it--so I would re-download the sample and try again. – Linda Z Jun 09 '16 at 00:43
0

This issue had been resolved by restarting node(npm) server. Below are the steps what I did.

  • Terminal - Ctrl+C to stop the npm server
  • Go to particular project folder, and add the plugins using below command

    cordova plugin add <plugin-name>

  • Restart the node server: remotebuild

Hope this helps to others.

Mrunal
  • 13,982
  • 6
  • 52
  • 96