Cordova android build error

左心房为你撑大大i 提交于 2019-12-12 09:46:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!