Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meteor run android goes Command failed with exit code EACCES #2690

Closed
stephentcannon opened this issue Sep 26, 2014 · 6 comments
Closed

meteor run android goes Command failed with exit code EACCES #2690

stephentcannon opened this issue Sep 26, 2014 · 6 comments

Comments

@stephentcannon
Copy link

meteor run android goes Command failed with exit code EACCES

and makes this

chronos@localhost ~/Downloads/projects/tests/mobtest2 $ meteor run android
Error running /home/chronos/user/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/cordova-scripts/cordova.sh
Error: /home/chronos/u-9bef7280b1b0a117e6979db2331865d71a5c3303/Downloads/projects/tests/mobtest2/.meteor/local/cordova-build/platforms/android/cordova/build: Command failed with exit code EACCES
    at ChildProcess.whenDone (/home/chronos/user/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:807:12)


Running command: /home/chronos/u-9bef7280b1b0a117e6979db2331865d71a5c3303/Downloads/projects/tests/mobtest2/.meteor/local/cordova-build/platforms/android/cordova/build 

To confirm my PATH for JDK

chronos@localhost / $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/home/chronos/user/npmprefix/bin:/home/chronos/user/java/jdk1.8.0_20/bin

The problem seems similar to these
http://stackoverflow.com/questions/24409541/cordova-build-command-failed-with-exit-code-eacces
and
http://stackoverflow.com/questions/20109929/cordova-android-build-fails-immediately-error-spawn-eacces

So, I tried chmod a+x on these scripts or scripts in dirs

/home/chronos/user/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/cordova-scripts/cordova.sh
 /home/chronos/u-9bef7280b1b0a117e6979db2331865d71a5c3303/Downloads/projects/tests/mobtest2/.meteor/local/cordova-build/platforms/android/cordova
~/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova

Decided to see what would happen if I ran superspawn.js directly

./superspawn.js 
./superspawn.js: line 1: /bin: Is a directory
./superspawn.js: line 2: syntax error near unexpected token `('
./superspawn.js: line 2: `    Licensed to the Apache Software Foundation (ASF) under one'

The above error makes me think something is wrong with my PATH for JDK?

The Meteor installation prompted me to install JDK but was unable to do so. So, I installed it myself.
https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration

Any ideas?

Repo is here
https://github.com/stephentcannon/mobtest2

@Slava
Copy link
Contributor

Slava commented Sep 26, 2014

Hi Steeeve,

It is hard to tell from your logs and the fact that you are running on ChromeOS doesn't make it much easier :)

But my guess would be: you have the 'ios' platform for this project and the Cordova is confused on to build the project for iOS.

Give me your output of meteor list-platforms. If it has iOS, then you can follow this instructions to clean that up on your machine:

meteor remove-platform ios
rm -rf .meteor/local/cordova-build

and then try building again. If this is not the case, please provide more info that you can collect or see if this happens on a different machine. Thanks.

The ios platform issue is already resolved on a git branch.

@stephentcannon
Copy link
Author

Here is list-platforms

chronos@localhost ~/Downloads/projects/tests/mobtest2 $ meteor list-platforms
android

then

chronos@localhost ~/Downloads/projects/tests/mobtest2 $ meteor remove-platform ios
ios is not in this project

then rm and sudo rm just in case

chronos@localhost ~/Downloads/projects/tests/mobtest2 $ rm -rf .meteor/local/cordova-build
chronos@localhost ~/Downloads/projects/tests/mobtest2 $ sudo rm -rf .meteor/local/cordova-build

then got a new error which is a good sign

meteor run android
Error running /home/chronos/user/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/cordova-scripts/cordova.sh

/home/chronos/user/.meteor/android_bundle/.cordova/lib/android/cordova/3.5.0-fix/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.
    at /home/chronos/user/.meteor/android_bundle/.cordova/lib/android/cordova/3.5.0-fix/bin/lib/check_reqs.js:47:27
    at ChildProcess.exithandler (child_process.js:651:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Socket.<anonymous> (child_process.js:968:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
Error: /home/chronos/user/.meteor/android_bundle/.cordova/lib/android/cordova/3.5.0-fix/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/home/chronos/user/.meteor/packages/meteor-tool/.1.0.32.v37egm++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/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:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)


Creating android project...

You guys are using apache ant for build process?

Obviously this is an edge case because I am on chromeos. But, in dev mode chromeos is merely just gentoo. I installed JDK last night and can run Java programs. Have node, npm and mongodb running external to meteor.

Obviously don't waste time on this. You guys have more important things to do.

Thank you for getting me a step closer. I will try installing ant and making sure it is in path and try again.

@Slava
Copy link
Contributor

Slava commented Sep 26, 2014

Yes, Cordova uses ant as well. I am closing this as sounds like you are hitting edge cases of installing the whole java env yourself (normally Meteor downloads all java environment for you into a separate folder).

@Slava Slava closed this as completed Sep 26, 2014
@stephentcannon
Copy link
Author

Can you confirm what is expected for Java in PATH and JAVA_HOME?

@Slava
Copy link
Contributor

Slava commented Sep 26, 2014

@stephentcannon
Copy link
Author

RAD! You are AWESOME!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants