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
cordova build android error spawn EACCES when I update Android Studio 3.0(Gradle 4.1) #2835
Comments
getting the same error here. Here's a repo with the error. Steps to reproduce:
|
I have been struggling with this for a few days now as well, let us know if you figure anything out. |
any fixes? |
After a long and really frustrating night I got mine woking. What is the root problem? I don't know. I do know that I recently downloaded the new android studio 3 and then this started being a problem. It probably is something to do with the 'gradle-4.1'. On a lot of other threads that contain this same issue there is someone strongly advising against just 'chmod'ing random folders, and I see his point, but I tried everything else. Before I ran the 'sudo chmod 777 ...", I deleted android studio and then reinstalled it. I hope this helps. EDIT: Just for additional detail, my .bash_profile, which I copied directly from the ionic setup guide for mac, specifics the targeted gradle file as 'gradle-3.2', yet my setup was not working until I ran the 'chmod' on the gradle-4.1/bin/gradle |
@kevintowe is right, use cordova with same problem,look at next step will cause problem
so then use next commond will see detail problem.
|
Having to sudo to change the permissions of the gradle executable isn't a clean solution. For those who don't want to use sudo, an option is to downgrade to AS 2.3 while this issue is being fixed. : https://developer.android.com/studio/archive.html |
I confirm the gradle need the good permission for the first launch after the update. You can get back to the original 644 after one build. |
Related comments: #2176 (comment) Making the gradle executable actually executable again doesn't seem that unclean to me. The usage of @bhandaribhumin's solution in the comments I linked to is the best known workaround, as far as I can tell:
Using an earlier version of Android Studio certainly will work, too. You can also install the Android SDK and gradle by itself, which is what I do. |
@dwieeb I agree with you somewhat, but wouldn't it be nice for ionic to work out of the box with Android Studio ? |
Same problem here, solved using Maybe if installing android-tools without Android Studio would solve the problem |
@hugodes Definitely! We always want to support the latest and greatest stuff (which is often why things break like this all the time 😆). If you'll follow those comments I linked to, I do link to this Cordova issue, which we're tracking. The issue is with Until then, the chmod workaround seems like the best fix for most people. |
@dwieeb Thanks 755 on the gradle script did the trick. |
@dwieeb my bad, didn't see the linked comment. Thanks for the update 😀 |
Saved my day. Same thing here, solved the problem. thx guys |
Thanks guys!! this really helps! |
Thank you guys, this works for me too. |
In Mac Mini : You can't directly get /Applications/Android....... , So Goto Following Path |
Nothing changing permissions fixed my issue |
Hi, cli packages: (/usr/local/lib/node_modules)
System:
Misc:
Also the error I get with
Some help could be really appreciated. Nice work with ionic by the way. |
So far this command does the job! Works like a charm!!! sudo chmod 755 "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle" |
you saved my day @dwieeb, thank you |
How do you find gradle if using a Macbook? I tried checking /Users/YourUserName/Library/Android/Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin/gradle but my machine only contains the sdk directory in /Users/YourUserName/Library/Android I also tried the command find . -name android\ studio.app from the users directory but it is not returning anything. ( I do have Android Studio in my Launchpad and I can open it without any issues). |
I solved my problem doing a:
Followed by a:
Because a reason that i cannot found, the latest Gradle version dont work with the cordova android 6.3.0. Hope it helps. :) |
Had this issue cause i was keeping 2 versions of android studio on a mac. version 2.1.0 & 3.0.1 with 2 different names 'Android Studio' & 'Android Studio 2'. Fixed by renaming new version to 'Android Studio'. |
@kevintowe Thanks! This really helped me a lot! |
Thanks @dwieeb this works for me! |
this line work perfect for me |
As mentioned above the permissions on the gradle executable are wrong: it doesn't have executable permissions. I use this
That only adds executable permissions and leaves the rest as in (worst idea is to give it 777 permissions as mentioned above) |
after more tryings and failed all ways, finally i solved it with this solution: 1- it will be solved. |
Thanks @moaazhomaid this works for me! |
I had the similar problem. I tried all the permission issue mentioned above. Did not work for me. Then I run cordova command in --verbose mode. I the found issue is with Android Studio gradle module. you need to give permission to android studio gradle bin.
|
I resolved it using this command.
|
This is Permission Error While Building App You Need to Give Permission Gradle sudo chmod -R 777 /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/gradle |
I am just adding my observation to this thread so that you guys have more info. |
@moaazhomaid thnks. Its work for me. |
grade version 3.2 works fine for me. |
Thanks @dwieeb this works for me and you saved my day! |
Thanks @kevintowe and Remember run I forgot that and still had this issue.. |
I had the same kind of issue and the chmod command described above didn't work for me. Running a verbose Cordova build got me closer to the issue: It stopped at: So I ran that command myself and it gave me the following error: Fixed it running the following command: Hope this helps anyone. |
Thanks! |
Ionic crodova platform rm android Because earlier i was build apk using android studio so the gradle version changed |
I had same issue. |
The permission fix of gradle worked for me, thanks! - although i do not understand what made this error happen, we didn't change anything. |
build passed, thanks to all :) |
(locked due to this being the most active issue from google) The fix is here: #2835 (comment) |
Description:
[ERROR] An error occurred while running cordova build android (exit code 1).
[17:43:12] lint finished in 2.41 s
bogon:cutePuppyPics Minzou$ cordova build android
ANDROID_HOME=/Users/Minzou/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Error: spawn EACCES
Steps to Reproduce:
ionic cordova build android --prod
Example repo:
Output:
ANDROID_HOME=/Users/Minzou/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Error: spawn EACCES
My
ionic info
:bogon:cutePuppyPics Minzou$ ionic info
cli packages: (/usr/local/lib/node_modules)
global packages:
local packages:
System:
Environment Variables:
Misc:
Other Information:
The text was updated successfully, but these errors were encountered: