Visual Studio的科尔多瓦构建失败 [英] Visual Studio Cordova build fails

查看:206
本文介绍了Visual Studio的科尔多瓦构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我建立与科尔多瓦任何Android应用程序,它失败

When I build any android app with Cordova, it fails with

类型错误:未定义无法读取属性'prepEnv

TypeError: Cannot read property 'prepEnv' of undefined.

我已经做了所有的故障诊断和检查环境变量(按MS文档)

I've done all the troubleshooting and checked environment variables (As per MS documentation)

我发现的是,如果我称之为 BLD \调试\平台\机器人\科尔多瓦\从我的项目文件夹中生成--ant --debug 的建筑工作。

What I found is that if I call bld\Debug\platforms\android\cordova\build --ant --debug from my project folder, the build works.

但是,当我打电话C:\用户\<使用者> \应用程序数据\漫游\故宫\\ node_modules \ VS-MDA \ VS-cli.cmd建--platform Android的 - 配置调试--projectDir。 --rojectName卡比--npmInstallDir C:\用户\<使用者> \应用程序数据\漫游\ NPM --language的en-US --buildTarget AndroidDevice ,构建失败

But when I call "C:\Users\<user>\AppData\Roaming\npm\\node_modules\vs-mda\vs-cli.cmd" build --platform Android --configuration Debug --projectDir . --rojectName Gappy --npmInstallDir C:\Users\<user>\AppData\Roaming\npm --language en-US --buildTarget AndroidDevice, the build fails.

之一的第二方法的步骤,是调用所述第一批处理文件。

One of the steps of the second method, is to call the first batch file.

这发生在VS2013和VS2015。 64位和32位版本的Node.js的

This happens with VS2013 and VS2015. 64 and 32 bit versions of Node.JS

任何帮助/想法?

推荐答案

我注意到,构建文件被称为differnetly根据路径解决方案是否包含空格:

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

1> ------构建配置选项: 1>运行命令:C:\项目\手机\ AppSolutionName \ AppSolutionName \ BLD \调试\平台\机器人\科尔多瓦\的build.bat --debug --ant

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

1> ------构建配置选项:--debug 1>运行命令:CMD/ S / C,C:\项目\手机Apps \ AppSolutionName \ AppSolutionName \ BLD \调试\平台\机器人\科尔多瓦\的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 ""

它的工作原理,如果有空间,也未能与类型错误:无法读取的未定义的属性'prepEnv',如果有没有。我不知道这是否是专门针对我的环境,但在路径的空间,我可以现在建立。

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.

这篇关于Visual Studio的科尔多瓦构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆