Cordoba: command failed with exit code EACCES

When I execute the "add android cordova platform", the command returns this:

Error: /Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin/create: command with EACCES exit code failed on ChildProcess.whenDone (/ usr / local / lib / node_modules / cordova / node_modules / cordova- lib / src / cordova / superspawn.js: 135: 23) in ChildProcess.emit (events.js: 95: 17) in Process.ChildProcess._handle.onexit (child_process.js: 818: 12)

I read that this could be a resolution problem, so I tried using the "sudo cordova platform add android", but the same error is returned.

I also tried using chmod 777 in the folder with the folder and platforms of my projects.

I tried to delete the platform folder, the folder was recreated, then the same error is returned.

For your information, the commands "java", "ant", "cordova", "npm" are recognized.

My only suggestion is that my SDK Path is wrong.

Here is what I did:

(I'm on Mac Yosemite for info)

I downloaded standalone SDK tools.

I created the / Development / Android folder and added the unzipped downloaded folder (android-sdk-macosx).

For your information, the "platform" folder is empty.

I added the path to / Development / Android / android -sdk-macosx / tools in / etc / path

I'm not sure if he should be here, any tips or solutions would be appreciated.

+6
source share
2 answers

I do not think the problem is in your project. The problem seems to be

/Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin/create 

which does not have the necessary rights to perform. Try applying something like this command to this folder

 chmod -R 777 /Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin 

He must grant all rights and, thus, create a creature to fulfill.

+4
source

@Brieuc Here is a solution to your new problem.

You need to specify the Android SDK Path in the .profile file located in your home.

In terminal

 sudo nano ~/.profile 

Then add these lines at the end, save and close .profile. (Perhaps you may have different paths for the Android SDK and ANT. ANT The path may not be needed for installation right now)

 export ANT_HOME=/usr/share/ant export ANDROID_HOME=/home/sagun/bin/android-sdk export PATH=$PATH:$ANT_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 

Now on the terminal you should notify the OS of changes made to .profile

 source ~/.profile 

If it is not, restart linux

Now you may run into some permission issues, go to your android-sdk / tools for this, and then type

 chmod +x android 

Hope this helps you :)

+2
source

Source: https://habr.com/ru/post/980490/


All Articles