Skip to content

Instantly share code, notes, and snippets.

@h3nr1ke
Created February 21, 2018 10:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3nr1ke/885e97c0c3f68dd1ca904dcc286ae777 to your computer and use it in GitHub Desktop.
Save h3nr1ke/885e97c0c3f68dd1ca904dcc286ae777 to your computer and use it in GitHub Desktop.
Fix Error: spawn EACCES when running cordova build android
# run it from your project folder
# based on this link
# https://github.com/ionic-team/ionic-cli/issues/2835
# erroroccurs when run...
cordova build android
# ANDROID_HOME=/usr/local/Caskroom/android-platform-tools/27.0.1
# JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
# Error: spawn EACCES
# it happens firts time you run or fist time after gradle update
# to fix it, execute this on gradle folder
sudo chmod -R a+rwx /Library/Java/JavaVirtualMachines *
sudo chmod -R a+rwx *
chmod 777 /Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin/gradle
#run again
cordova build android
# after the build, change back to 644 permission
chmod 644 /Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin/gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment