Visual Studio Cordova build fails

China☆狼群 提交于 2019-12-05 05:33:33

I noticed that the build file is called differnetly depending on whether the path to the solution contains spaces:

1> ------ Build configuration options: 1> Running command: C:\Projects\Mobile\AppSolutionName\AppSolutionName\bld\Debug\platforms\android\cordova\build.bat --debug --ant

1> ------ Build configuration options: --debug 1> Running command: cmd "/s /c ""C:\Projects\Mobile Apps\AppSolutionName\AppSolutionName\bld\Debug\platforms\android\cordova\build.bat" --debug --ant ""

It works if there are spaces and it fails with "TypeError: Cannot read property 'prepEnv' of undefined" if there are none. I don't know if this is specific to my environment but with the spaces in the path I can build now.

On Mac OS X Yosemite:

Cleaning the project and rebuilding it with sudo fixed it for me.

On /path/to/your/project/platforms/android/cordova folder:

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