下载并安装Multi-Device Hybrid Apps for Visual Studio CPT1后,我创建了一个TypeScript / Multi-Device Hybrid App项目。我能够使用Android和iOS目标构建项目,但是当我将目标平台切换到WP8时,出现了错误(这全部来自VS):
1. MSBuild failed to create .xap when building cordova-wp8 for debugging.
2. X:\...\bld\Debug\platforms\wp8\cordova\build.bat: Command failed with exit code 2
3. The command ""X:\...\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Windows Phone" --configuration "Debug" --projectDir . --projectName "x" --buildServerUrl "" --buildTarget "PhoneEmulatorWvga512"" exited with code 8.
所以我决定手动尝试并得到以下错误:
X:\...\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
throw e;
^
Error: X:\...\bld\Debug\platforms\wp8\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (X:\...\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
这都是干净安装和VS2013 Update 2.
答案 0 :(得分:1)
我通过清除注册表项解决了问题:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Environment \ Platform
值得注意的:
我不相信这个问题特定于Cordova VS集成,而是我的环境设置与Cordova很好地解决了问题。