← All writing

Visual Studio Tools for Apache Cordova Error, MDAVSCLI failed with code 8

I recently installed Visual Studio Tools for Apache Cordova CTP 3.1 in Visual Studio 2013 with Update 4 and when trying to build I kept getting the error:

Command failed with exit code 8 Visual Studio - mdavscli

The problem was that I has upgraded my version of Android SDK which was not compatible.

To troubleshoot this I turned on the diagnostic build here is how:

Go to Tools –> Options –> Projects and Solutions –> Build and Run, change MSBuild project build output verbosity to Diagnostic. Rebuild the project and post the text from output window

The output window showed the following error:

BUILD FAILED C:\Programs\SDK\tools\ant\build.xml:597: The following error occurred while executing this line: C:\Programs\SDK\tools\ant\build.xml:649: The following error occurred while executing this line: C:\Programs\SDK\tools\ant\build.xml:694: Execute failed: java.io.IOException: Cannot run program "C:\code\samh\platforms\android\CordovaLib${aapt}" (in directory "C:\code\samh\platforms\android\CordovaLib"): CreateProcess error=2,

after a little research I found out it looks like ant commands are broken in Android SDK 24.3, which cordova build is using. I downgraded to previous release (24.2.0) and ant works fine now.

I downgraded to the following version of the sdk http://dl-ssl.google.com/android/repository/tools_r24.2-windows.zip

To downgrade:

  • Find your Android SDK folder

  • Locate the "tools" subfolder and rename it to "tools1" (just to keep a backup copy of the original tools folder)

  • Likewise, rename platform-tools to platform-tools1

  • Download from google repository the SDK Tool version you want to downgrade to (for instance: http://dl-ssl.google.com/android/repository/tools_r24.2-windows.zip) and unpack it.

  • The ZIP file you downloaded contains a tools folder that has to be moved to your Android SDK folder.

  • Likewise, download the platform tools (for instance: https://dl-ssl.google.com/android/repository/platform-tools_r19-windows.zip), and extract it in your SDK folder.