Build fails when adding cordova plugin in Visual Studio
I apologize if this question has been asked before, but my search on this topic did not lead to a solution that worked for me.
I am trying to migrate a web app that was devoloped and build with cordova cli to microsoft visual studio project with new community edition. (using multi-device extension and visual studio mashups)
The plugins I want to use:
- org.apache.cordova.battery-status
- org.apache.cordova.device
- org.apache.cordova.globalization
- org.bcsphere.bluetooth
- plugin I created myself
- org.stereolux.cordova.serial
Everything works fine until I try to import the usb-serial-plugin that I used before. https://github.com/stereolux/cordovarduino
But now, unfortunately, the build always fails with the "Command failed with exit code 8" error during build.bat.
What has already been done:
- three environment variables are correctly defined (ADT_HOME, JAVA_HOME, ANT_HOME)
- delete internal folder inside project
- clear cordova cache (inside visual studio settings)
- update all required packages using SDK manager
- change the project path without spaces
I don't know how to fix this issue and hope someone here can help me.
EDIT: some details when I try to build bld / Debug with CLI CLOCK
STRICTLY MALFUNCTION 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 compile; see the compiler error output for details.
Total time: 4 seconds
D: \ VSCE2013 \ Projects \ BlankCordovaApp \ BlankCordovaApp \ wd \ Debug \ platform \ 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 \ platform \ android \ cordova \ build.bat: code failed with exit code 8 in ChildProcess.whenDone (C: \ Users \ wunderlichhe.WORKGROUP.000 \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-lib \ src \ cordova \ superspawn.js: 135: 23) in ChildProcess.emit (events. js: 98: 17) at maybeClose (child_process.js: 755: 16) in Process.ChildProcess._handle.onexit (child_process.js: 822: 5)
source to share
If you look at the README.md plugin, you can see this:
Install it
In 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 VS Tools for Apache Cordova CTP3 released last week, then these steps will help solve your problem:
Copy this file: plugins \ org.stereolux.cordova.serial \ lib \ usbseriallibrary.jar
in: res \ native \ android \ libs \ usbseriallibrary.jar
After that the build will be successful
source to share