Search code examples
androidvisual-studiocordovaantmulti-device-hybrid-apps

The command x prepare --platform Android --configuration Debug --projectDir . --projectName y exited with code 8


I am trying to start developing app with multi-device-hybrid-app for visual studio.

After setting all system variables my errors are these

  1. Error 4 The command ""C:\Users\userName\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Debug --projectDir . --projectName "name" --language "en-US"" exited with code 8.
  2. Error 2 executing command 'ant', make sure you have ant installed and added to your path.
  3. Error 3 C:\Users\userName.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8

what I have done

  1. Read all questions about this argument in SO without success
  2. Added ADT_HOME with value C:\Program Files (x86)\Android\android-sdk
  3. Added ANT_HOME with value C:\apache-ant-1.9.3
  4. Added JAVA_HOME with value C:\Program Files (x86)\Java\jdk1.7.0_71
  5. Edited Path system variable as suggested in this question
  6. Deleted the bld folder from the project as suggested in this question
  7. Updated Android API from Android SDK manager (I have 8,10 and from 16 to 21)

I don't know what to try, I have tryed everything (reinstall VisualStudio and Java from zero)

I have VisualStudio 2013 ultimate with Windows 7 pro

Can anyone help me?

UPDATE: this is my Multi Device Hybrid Apps enviroment configuration

enter image description here


Solution

  • After one day spent looking for missing variables to set I discover that the problem was caused by a missing information in Path variable.

    Just add %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;, restart VisualStudio and everything works great!