1

I'm using Visual Studio 2013 and the Cordova CTP 1.1. When I try to build the project, I get the following cryptic error (line breaks added for readability):

Error 22 
The command ""C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\vs-cli"
prepare --platform Android --configuration Debug
--projectDir . --projectName "servermon"" exited with code 8.
C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 115 5 servermon

I've tried the solutions from this question as well as this question, and this doesn't appear to solve the issue. My system path appears to have everything relevant in it:

C:\Program Files\Java\jdk1.7.0_60\bin
C:\Users\Nathan\AppData\Local\Android\android-sdk\tools
C:\Users\Nathan\AppData\Local\Android\android-sdk\platform-tools
C:\apache-ant-1.9.3\bin
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files (x86)\Windows Live\Shared
C:\Program Files\Microsoft\Web Platform Installer\
C:\Program Files (x86)\nodejs\
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\ 

I've also opened up the SDK manager and made sure to get the latest (Rev 19) build tools. The system has been restarted more than once and I'm still not able to build. Does anyone have any ideas on how to fix this build issue?

Edit: Here is a screenshot of my SDK Manager Android SDK Manager

Edit2: Here is the build output

1>------ Build started: Project: servermon, Configuration: Debug Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(90,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1>  Your environment has been set up for using Node.js 0.10.26 (ia32) and npm.
1>  ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\al3uox1v.u2n\packages\vs-mda
1>  ------ Build settings:
1>  ------    buildCommand: prepare
1>  ------    platform: Android
1>  ------    cordovaPlatform: android
1>  ------    configuration: Debug
1>  ------    cordovaConfiguration: Debug
1>  ------    projectName: servermon
1>  ------    projectSourceDir: C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest
1>  ------ App dir C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\bld\Debug already exists
1>  ------ Copying app files to www
1>  ------ Done copying app files to www
1>  ------ Copying res files
1>  ------ Done copying res files
1>  ------ Platform android already exists
1>  ------ Certificate copy from C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\res\cert\android to platforms\android
1>  ------ Done copying certificate files to platforms\android
1>  
1>  C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>  CordovaError: The provided path "C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\bld\Debug\platforms\android" is not an Android project.
1>      at Object.android_parser (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\metadata\android_parser.js:37:15)
1>      at C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\prepare.js:51:23
1>      at Array.map (native)
1>      at Object.prepare (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\prepare.js:49:35)
1>      at preparePlatform (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\app.js:322:24)
1>      at _fulfilled (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:787:54)
1>      at self.promiseDispatch.done (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:816:30)
1>      at Promise.promise.promiseDispatch (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:749:13)
1>      at C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:557:44
1>      at flush (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:108:17)
1>C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets(115,5): error MSB3073: The command ""C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Debug --projectDir . --projectName "servermon"" exited with code 8.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Priyank
  • 1,568
  • 10
  • 15
Nathan
  • 2,093
  • 3
  • 20
  • 33
  • .@Nathan - it's definitely an Android issue. Seems like your APIs may not be up to date. Could you add a screenshot from your SDK manager? – Priyank Jun 04 '14 at 15:45
  • @Priyank screenshot's been added. – Nathan Jun 04 '14 at 15:52
  • did you install and configure Java manually? The installer installs the x86 version of Java (it's the only supported one) and the path should look something like: C:\Program Files (x86)\....\... – Priyank Jun 04 '14 at 20:33
  • I switched the Java path while trying to remedy this build issue. I've switched the JAVA_HOME back to the 32-bit installation and restarted, but there's no change in the behavior. – Nathan Jun 04 '14 at 22:28
  • any chance you could share more of your build output. It's hard to figure out the issue with the current data. – Priyank Jun 05 '14 at 17:29
  • Build output's posted. I appreciate the troubleshooting help :) – Nathan Jun 06 '14 at 01:03

3 Answers3

9

It seems the Android template that was downloaded by Cordova is "corrupted".

To fix this: Try deleting the cached android platform in your user directory:

C:\users\<username>\.cordova\android\*

Then, clean and build the Solution in Visual Studio. Or to be really sure, delete the ‘bld’ directory inside the project folder.

This should force Cordova to re-download the Android template and fix the issue.

Priyank
  • 1,568
  • 10
  • 15
  • Cool, project built and was able to run in Ripple & on-device. I had a though while I was at work today: I renamed the project before, is it possible that's what caused the directory to be corrupted? I renamed it from within Visual Studio so I didn't even think about before. – Nathan Jun 07 '14 at 00:27
  • 1
    I'm having the same problem, but there is no `android` folder under `C:\users\\.cordova\ ` for me. I've also deleted `bld` folder, cleaned the project, but the problem didn't go away. – Shalom Aleichem Nov 16 '14 at 21:14
  • There is no .cordova folder at that location. – Jase Apr 08 '15 at 18:20
2

for me I just deleted the bld folder and eveerything has become right

Reza
  • 18,865
  • 13
  • 88
  • 163
1

Some time visual studio catch creates problem, clear the cache.

  1. Choose Tools, Options, Tools for Apache Cordova, and then choose Cordova Tools.

  2. Choose Clear Cordova Cache.

  3. Close and re-open your project.

  4. Choose Build, Clean Solution.

Sutirth
  • 922
  • 10
  • 14