2
votes

I thought I would try to build a cordova app with Visual Studio 2015, I normally use different IDEs for this (intellij and Netbeans) without any problems but fancied trying a new tool (as I do use VS for some web apps).

I have installed VS2015 Community and installed with the cordova tooling.

I thought I would do a test with the defaults and run, but I get build errors as per screen shot

enter image description here

Not sure what its on about..... If I run VS 2015 as administrator ( shortcut option - even though my user account is admin - nice one windows), I still get a build issue but no errors reported , anyone else experienced this ?

Running as Admin this is what screens look like for a blank cordova app

enter image description here

which I enabled by setting shortcut

enter image description here

4

4 Answers

2
votes

As suggested above by @DeanB_Develop I looked at the output. which for interest is as follows;

    All packages are already installed and there is nothing to restore.
    NuGet package restore finished.
    1>------ Build started: Project: BlankCordovaApp2, Configuration: Debug Android ------
    1>  Your environment has been set up for using Node.js 0.10.35 (x64) and npm.
    1>  ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
    1>  ------ Name from source package.json: vs-tac
    1>  ------ Version from source package.json: 0.2.19
    1>  ------ Package not currently installed globally.
    1>  ------ Installing globally from source package. This could take a few minutes...
    1>  npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.10.35","npm":"2.1.5"})
    1>  C:\Program Files (x86)\nodejs\vs-tac-cli -> C:\Program Files (x86)\nodejs\node_modules\vs-tac\vs-tac-cli.cmd
    1>  [email protected] C:\Program Files (x86)\nodejs\node_modules\vs-tac
    1>  ├── [email protected]
    1>  ├── [email protected]
    1>  ├── [email protected]
    1>  ├── [email protected]
    1>  ├── [email protected]
    1>  ├── [email protected]
    1>  ├── [email protected] ([email protected], [email protected])
    1>  ├── [email protected] ([email protected])
    1>  ├── [email protected] ([email protected], [email protected])
    1>  ├── [email protected] ([email protected], [email protected])
    1>  ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    1>  ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    1>  └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    1>  ------ npm install failed. Exit code: 0
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

The only thing I could see was a npm WARN but not sure if this was causing the problem.

So I visited the following page after googling that shows the tools that can be installed independatly https://msdn.microsoft.com/en-au/library/dn771551.aspx

The only thing that stood out was 'Ant'. I currently have it installed but its WinAnt living in my Program files. I did choose the option for Ant when installing the cordova tools so not sure what happened to that- maybe my winant scared it off...

I downloaded the version from that page and extracted it to a folder c:\apache-ant-x.x.x.

Then updated the ANT_HOME environment variable to point to the new folder rather than WinAnt and also added the new folder path to the system path.

Then loaded Visual studio again and run the project.

working project example

Yay it works, now to start doing some actual work :).

1
votes

Check the output window after your build. This will provide much more detailed information. You can access the output window:

View > Output

or

CTRL + W, O

In the "Show output from:" drop down, select "build"

0
votes

When you initially installed VS 2015, did you choose to install the "Common Tools and Software Development..." feature. If not, go to Windows' Add/Remove programs in the Control Panel, and choose to modify the VS 2015 installation and checkmark it. Hope this helps.

Screenshot of VS 2015 RC Install

0
votes

Download APACHE ANT and extract it to a folder c:\apache-ant-x.x.x. Then updated the ANT_HOME environment variable to point to the new folder (rather than WinAnt) and add the new folder path to the system path. ;)