问题
I get this error, when i try to build and run an cordova project on an android device:
Running app on platform "android" via command "***/Documents/***/App/platforms/android/cordova/run" --device
[Error: An error occurred while running the android project.
/***/Documents/***App/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error executing "ant clean -f /***/Documents/***/App/platforms/android/build.xml": Build failed
Any suggestion on fixing this problem?
回答1:
Check if "adb devices" command works. If it doesn't work ensure "android-tools-adb" is installed and then run the "adb devices" command. Rerun the build after that.
回答2:
This happened to me when I upgraded the CLI cordova (via npm) to 3.3.1 but forgot up update my project to the corresponding version. This fixed it for me:
cordova platform update android
来源:https://stackoverflow.com/questions/20188728/cordova-android-build-error