Markus
Markus

Reputation: 45

Build fails when adding cordova plugin to Visual Studio

I'm sorry if this question has been asked before, but my reserch on this topic did not result in a solution that worked for me.

I am trying to port a web-app that was devoloped and build with cordova cli, into a microsoft visual studio project with the new community edition. (using the multi-device-hybrid-apps extension for visual studio)

The plugins that i want to use:

All works well untill i try to import a usb-serial-plugin that i was using before. https://github.com/stereolux/cordovarduino

But now unfortunally the build always fails with "Command failed with exit code 8" error during build.bat.

What ive already tried:

I dont know how to fix this problem and hope someone here can help me.

EDIT: Some details when i try to build the bld/Debug with Cordova CLI

BUILD FAILED D:\Android SDK\sdk\tools\ant\build.xml:720: The following error occurred while executing this line: D:\Android SDK\sdk\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 4 seconds

D:\VSCE2013\Projects\BlankCordovaApp\BlankCordovaApp\bld\Debug\platforms\android \cordova\node_modules\q\q.js:126 throw e; ^ Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\VSCE2013\Projects\BlankCordovaApp\BlankCordovaApp\bld\Debug\platforms\android\build.xml,-Dout.dir =ant-build,-Dgen.absolute.dir=ant-gen Error: D:\VSCE2013\Projects\BlankCordovaApp\BlankCordovaApp\bld\Debug\platforms\android\cordova\build.bat: Command failed with exit code 8 at ChildProcess.whenDone (C:\Users\wunderlichhe.WORKGROUP.000\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:755:16) at Process.ChildProcess._handle.onexit (child_process.js:822:5)

Upvotes: 3

Views: 2560

Answers (1)

gserrato
gserrato

Reputation: 166

If you look at the plugin README.md, you can see this:

Install it

From the root folder of your cordova project, run : cordova plugin add https://github.com/stereolux/cordovarduino.git cp plugins/org.stereolux.cordova.serial/lib/usbseriallibrary.jar platforms/android/libs

If you are using the VS Tools for Apache Cordova CTP3 released last week then these steps will fix your issue:

copy this file: plugins\org.stereolux.cordova.serial\lib\usbseriallibrary.jar

into: res\native\android\libs\usbseriallibrary.jar

Build will succeed after that

Upvotes: 1

Related Questions