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

前端 未结 8 2060
长情又很酷
长情又很酷 2020-12-09 08:50

cordova build android gives me the following err

node_modules/q/q.js:126 throw e; (*error details)

This question has been asked before, but

相关标签:
8条回答
  • 2020-12-09 09:24

    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!

    0 讨论(0)
  • 2020-12-09 09:25

    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.

    0 讨论(0)
  • 2020-12-09 09:26

    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.

    0 讨论(0)
  • 2020-12-09 09:28

    @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.

    0 讨论(0)
  • 2020-12-09 09:35

    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).

    0 讨论(0)
  • 2020-12-09 09:35

    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.

    0 讨论(0)
提交回复
热议问题