问题
I'm building a cordova application and trying to run "cordova build wp8" in the cmd prompt, but this seems to be erroring out:
Your environment has been set up for using Node.js 0.10.25 (x64) and npm.
C:\path\to\project>cordova build wp8
Generating config.xml from defaults for platform "wp8"
Preparing wp8 project
Compiling app on platform "wp8" via command "cmd" /c C:\path\to\project\platforms\wp8\cordova\build
Error: An error occurred while building the wp8 project.ERROR: MSBuild failed to
create .xap when building cordova-wp8 for debugging.
at ChildProcess.<anonymous> (C:\Users\Mark\AppData\Roaming\npm\node_modules\
cordova\src\compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
回答1:
Cordova docs instruct you to add this to the wp8 platform files:
<Capabilities>
<Capability Name="ID_CAP_ISV_CAMERA" />
<Capability Name="ID_HW_FRONTCAMERA" />
</Capabilities>
The second line breaks the build. Removing:
<Capability Name="ID_HW_FRONTCAMERA" />
fixed this issue.
回答2:
Mine is doing the same thing but giving these lines:
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I'm not sure why. Another app is building --release just fine.
回答3:
Did you try to compile an WP8-App on a Windows 7 System? I think this not possible because you need Windows 8 for this ... I got the same error and compiling for WP7 worked for me.
回答4:
From my limited experience there appears to be a limitation with the cordova wp8 CLI build. If I include any plugins with native components (e.g. SQLite) the build must be targeted at ARM for a device/x86 for the emulator. The cordova wp8 tools are unaware of this and assume it's all working with AnyCPU. Consequently when platforms/wp8/cordova/lib/build.js checks that a .xap file was produced by the build in "BIN\Debug" it fails to find the xap created in "Bin\ARM\Debug" (or Bin\x86\Debug if building for an emulator).
The application is built by the CLI, and can also be built/launched/debugged from Visual studio - but that's a pity when the other platforms can be managed from the CLI.
来源:https://stackoverflow.com/questions/22669292/msbuild-failed-to-create-xap-when-building-cordova-wp8-for-debugging