Question

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)
Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top