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

corova build android gives me the following err

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

This question has been asked before, but the typical answer about PATH and ANDROID_HOME did not work for me.

I put this in a code snippet to avoid problems sending SO

 export HOME="/Users/rover" export ANDROID_SDK="$HOME/Documents/Dev/Android/adt-bundle-mac-x86_64-20140702/sdk" export ANDROID_HOME="$ANDROID_SDK/tools" export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK/platform-tools" export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$ANDROID_SDK/build-tools:$PATH" export ANT_HOME="/usr/local/bin/ant" #export PATH="$PATH:$ANT_HOME/bin" 

My environment variables:

$ set | grep "ANDROID \ | PATH"

ANDROID_HOME = / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / SDK / tools ANDROID_PLATFORM_TOOLS = / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / SDK / platform tools ANDROID_SDK = / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / SDK PATH = / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / SDK / tools: / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / SDK / platform tools: / Users / rover / Documents / Dev / Android / insert-bundle-mac-x86_64-20140702 / Sdk / assembly-tools: / usr / local / bin: / usr / bin: / bin: / usr / sbin: / sbin: / opt / x 11 / bin

 $ which ant /usr/local/bin/ant $ ls /usr/local/bin/ant /usr/local/bin/ant $ cordova --version 4.0.0 $ ant -v Apache Ant(TM) version 1.9.4 

I am on Mac OSX 10.10 (Yosemite) which may have a problem with Java 8. Could this be related?

$ java -version java version "1.8.0_05" Java (TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot (TM) 64-bit server VM (build 25.5-b02, mixed mode)

 $ ant --execdebug exec "/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/bin/java" -classpath "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant-launcher.jar" -Dant.home="/usr/local/Cellar/ant/1.9.4/libexec" -Dant.library.dir="/usr/local/Cellar/ant/1.9.4/libexec/lib" org.apache.tools.ant.launch.Launcher -cp "" (*error details) BUILD FAILED /Users/rover/Documents/Dev/Android/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:653: The following error occurred while executing this line: /Users/rover/Documents/Dev/Android/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:698: null returned: 1 Total time: 1 second /Library/WebServer/Documents/Booster/core_ionic_git/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: ant with args: debug,-f,/Library/WebServer/Documents/Booster/core_ionic_git/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen Error: /Library/WebServer/Documents/Booster/core_ionic_git/platforms/android/cordova/build: Command failed with exit code 8 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:756:16) at Process.ChildProcess._handle.onexit (child_process.js:823:5) 

Any ideas on fixing this?

+25
android cordova ant node-modules ionic
Nov 06 '14 at 15:49
source share
8 answers

I noticed that your ANDROID_HOME variable may be incorrectly configured - as far as I can tell, it should be installed in the root of your SDK folder (that you have ANDROID_SDK installed), try (and make sure that you are still in your way as $ ANDROID_HOME / tools, and $ ANDROID_HOME / platform-tools).

+9
Nov 06 '14 at 21:08
source share

I knocked my head on the wall for hours and hours and eventually 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 "corova build android" and it worked like a charm.

I think Cordoba wanted to update some files.

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

If you use an ionic structure, then these are the commands for your salvation:

 ionic platform remove android ionic platform add android 

I noticed that this usually happens when you interrupt (Ctrl-C) the compilation process.

+20
Jan 02 '15 at 7:34
source share

I run the same problem and solve it by avoiding letters without a letter in config.xml . Partially for the name attribute:

 <name>Temps d'espera</name> 

I changed it to:

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

And then it works fine. Hope this helps.

+2
Mar 15 '15 at 19:50
source share

@mylord I had a similar error and this was due to an invalid debug certificate. On Linux, delete the ~ / .android debug.keystore file.

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

It decided for me. Hope this helps.

+1
Nov 11 '14 at
source share

I ran into this problem when running 'phonegap serve', but the solution was completely different. I noticed that the operation will work when I restart my computer. In case someone 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 stackoverflow Grunt view error - Waiting ... Fatal error: see ENOSPC

In addition to the poster error, I had an 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.

+1
Feb 18 '16 at 19:46
source share

I encounter the same error message, but my ANDROID_HOME setting is correct. I found that the error was caused by the fact that I open the .apk file in the \ platform \ android \ ant -build folder. After closing 7zip, which occupy the .apk file, ant passed.

0
Jan 13 '15 at 9:03
source share

Before changing anything, make an empty cordova project and try to build it, and you can understand that the problem is related to a specific project or not.

After many changes that I made, I realized that we should not have two folders with the same name: jquery and jquery !

0
Feb 18 '15 at 12:14
source share

I had the same problem. This was due to the presence of an application with the same name (and the same reverse-style domain name in my case) installed on the Android device that came from the Google Play store (this was our beta release).

0
Feb 27 '15 at 15:36
source share



All Articles