ionic-cli: Ionic build android, Error: spawn EACCES
What version of the CLI are you using? Output of ionic --version
2.2.3
Short description of the problem:
I downloaded a fresh instalation of ionic and cordova, then I created a new project, then I added the android platform and tried to build. The build fails with Error: spawn EACCES
.
What behavior are you expecting?
The projects should build succesfully.
Steps to reproduce:
- sudo npm install -g cordova ionic
- ionic start myApp tabs
- cd myApp
- ionic platform add android@6.2.2 //6.1.x has a bug
- ionic build android
Post the output of ionic info
below please
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.6
ios-deploy version: 1.8.5
ios-sim version: 5.0.13
OS: OS X El Capitan
Node Version: v6.10.1
Xcode version: Xcode 7.3.1 Build version 7D1014
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 33 (3 by maintainers)
@alexharvey assuming you’re on mac (or linux):
WOW it’s working. sudo cordova run android --verbose
change permissions of that file like this sudo chmod 755 “/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle”
Running ionic build android --verbose gives the following output:
Changing the permissions of
/Applications/Android Studio 2.4 Preview.app/Contents/gradle/gradle-3.4.1/bin/gradle
solves the problem.@djonmayer: i figured it out:
sudo cordova run android --verbose
look for the error message:
Running command: "/Applications/Android Studio 3.0 Preview.app/Contents/gradle/gradle-4.0-milestone-1/bin/gradle"
change permissions of that file like this
sudo chmod 755 /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/gradle/gradle-4.0-milestone-1/bin/gradle
look at the slashes before the spaces. this is likely what you are missing
@AwesomeJ0sh thanks, i figured it out i made the gradlew file executable
chmod +x /home/davinci/Tutorials/ionic/favourite-app/platforms/android/gradlew
Thank you it solved my problem as well
sudo chmod 755 “/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle”
works fines for me. the problem is the android studio app upgrade.
I had similar error on Mac when I updated my Android Studio to version 3.x. I found the following command to fix it: sudo chmod 755 /Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin/gradle
@timofeysie hey man. I know what you mean. I was frustrated for a while too.
It seems you are experiencing two different errors.
the first error has to do with this file:
/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle
change permissions to this gradle file like thissudo chmod 755 /Applications/Android\ Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle
However. it doesn’t seem like you are at this point because your second error has to do with the installation android studio. You have to complete it by opening it and accepting their license? I don’t know first hand I have never experienced it.
aside: I also program on a mac. Include sudo with most commands if they fail on permission the first time.
sorry
sudo chmod 755 /home/davinci/Tutorials/ionic/favourite-app/platforms/android/gradlew\ cdvBuildDebug