Phonegap/Cordova build android node_modules/q/q.js throw e;

南笙酒味 提交于 2019-11-28 08:08:28

I noticed that your ANDROID_HOME variable might be incorrectly setup - as far as I can tell, it should be set to the root of your SDK folder (what you have ANDROID_SDK set to), try that (and make sure that you still have both $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools on your path).

I banged my head against the wall for hours and hours and ultimately came up with a simple solution. I went into the project directory and issued two commands:

cordova platform remove android
cordova platform add android

Recompiled with "cordova build android" and it worked like a charm.

I think cordova wanted to possibly update some files.

===== Update for Ionic ========

In case you are using ionic framework then these are the commands for your rescue:

ionic platform remove android
ionic platform add android

I have noticed that this normally happens when you break (Ctrl-C) the compilation process.

I run in the same problem and solved it by escaping non-letter characters in config.xml. Particulary for the name attribute:

<name>Temps d'espera</name>

I changed it to:

<name>Temps d\'espera</name>

And then it run perfectly. Hope it helps.

@mylord I had similar error and it was due to invalid debug certificate. On Linux Delete ~/.android debug.keystore file.

The next time you build, the build tools will regenerate a new keystore and debug key.

This solved for me. I hope this helps.

user3071643

I ran into this same problem while running 'phonegap serve', but the solution was very different. I noticed that operation would work when I restarted my computer. In case anyone else runs into this problem. Here is the solution on Ubuntu 15

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

which was taken from the stackoverflow thread Grunt watch error - Waiting...Fatal error: watch ENOSPC

In addition to the posters error, I had the error

at exports._errnoException (util.js:856:11)
at FSWatcher.start (fs.js:1313:19)
at Object.fs.watch (fs.js:1341:11)

further down.

I meet same error message, but my ANDROID_HOME setting is correct. I find the error is caused by I opening a .apk file in the \platforms\android\ant-build folder. After I close 7zip that occupy the .apk file, ant build passed.

Before changing anything, make an empty cordova project and try to build it and you can figure out the problem is project specific or not.

After a lot of change i made, i figured out we shouldn't have two folders with same names : jquery and jQuery!

I had the same issue. It was caused by having an App with the same name (and the same reverse style domain name in my case) installed on the Android Device which originated from the Google Play store (it was our Beta release).

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