Cannot run Cordova Applications using Visual Studio 2013

自作多情 提交于 2019-12-02 19:08:37

问题


I have installed all third party setups required for "Multi Device Hybrid Apps" successfully. But when i go to run my app using Visual Studio 2013 it gives me following two errors :

Error 1:    cmd: Command failed with exit code 255  
Error 2: The command ""C:\Users\PC-Name\AppData\Roaming\npm\node_modules\vs-mda\vs-cli"
    prepare --platform Android --configuration Debug --projectDir . --projectName "Test2"
    --language "en-US"" exited with code 8.

I have checked all Environment Variables which are at there right variables.

Kindly tell me how to get rid off from above errors.....


回答1:


Exit code 8 often indicates that at least one of the environment variables that Cordova requires for build has not been added to your path. There are three environment variables that must be defined:

1) %JAVA_HOME% -- C:\Program Files(x86)\Java\jdk1.7.0_55

2) %ADT_HOME% -- C:\Users\YOUR_NAME_GOES_HERE\AppData\Local\Android\android-sdk

3) %ANT_HOME% -- C:\apache-ant-1.9.3

Note -- The paths for these tools may be different on your PC. You need to verify the actual install paths for each.

Once you have defined these variables, copy the entry below into your System path variable. Reboot PC after making these changes.

%JAVA_HOME%\bin;%ADT_HOME%\tools;%ADT_HOME%\platform-tools;%ANT_HOME%\bin;

A similar question was covered in an earlier post.




回答2:


I figured out the real cause, just update your node.js or either remove spaces from project directory path.

For Example :
Before Project Directory Path : C:/Users/Jon Snow/MyProjects/ProjectName
After Project Directory Path : C:/Users/JonSnow/MyProjects/ProjectName



来源:https://stackoverflow.com/questions/25464326/cannot-run-cordova-applications-using-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!