generator-ionic
generator-ionic copied to clipboard
Adding new cordova plugin gives EACCES error
grunt plugin:add:https://github.com/apache/cordova-plugin-network-information.git
Running "plugin:add:https://github.com/apache/cordova-plugin-network-information.git" (plugin) task
Fetching plugin "https://github.com/apache/cordova-plugin-network-information.git" via git clone
>> Error: spawn EACCES
>> at exports._errnoException (util.js:746:11)
>> at ChildProcess.spawn (child_process.js:1155:11)
>> at Object.exports.spawn (child_process.js:988:9)
>> at Object.exports.spawn (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:104:31)
>> at execute_scripts_serially (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/cordova-lib/src/cordova/hooker.js:145:31)
>> at fireHooksInDir (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/cordova-lib/src/cordova/hooker.js:72:24)
>> at /Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/cordova-lib/src/cordova/hooker.js:82:20
>> at _fulfilled (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/q/q.js:798:54)
>> at self.promiseDispatch.done (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/q/q.js:827:30)
>> at Promise.promise.promiseDispatch (/Users/sixtooth/project/rxposts/pharmacist/node_modules/cordova/node_modules/q/q.js:760:13)
Warning: Task "plugin:add:https://github.com/apache/cordova-plugin-network-information.git" failed. Use --force to continue.
Aborted due to warnings.
me too
Is this on a Unix like OS? I initially faced a similar error when adding a platform in both Linux and OS X to a project that had it's git repo created on a Windows machine. Check the permissions of your cordova hook scripts under project_folder/hooks. In my case, they were missing the executable flag, and a quick 'chmod +x' to all the js hook files solved it.
thanks @kzsolti, resolved by running "chmod +x hooks/after_prepare/010_add_platform_class.js "
thanks as well @kzsolti. "chmod +x hooks/after_prepare/010_add_platform_class.js" worked for me as well.
OK. Can someone please solve this for good? There is no fun in running chmod 777 for every .js file i create for a new project ?
I think the fact that I was using tmux was also an issue. Tried the same set of commands outside tmux and it worked.
I did this to fix the issue manually:
chmod 755 hooks/after_prepare/*
rm -rf platforms/android
ionic platform add android
@dcu Thanks I worked on my mac!
The problem is you have to do that every time you make a new app.
I hope someone have a solution for this
I am facing this problem. Can somebody help me out
error caught: Error: spawn EACCES /home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error: spawn EACCES at exports._errnoException (util.js:746:11) at ChildProcess.spawn (child_process.js:1162:11) at Object.exports.spawn (child_process.js:995:9) at module.exports (/home/kwanso/todo/platforms/android/cordova/lib/spawn.js:37:35) at /home/kwanso/todo/platforms/android/cordova/lib/build.js:343:24 at _fulfilled (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:760:13) at /home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:821:14 at flush (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:108:17) ERROR building one of the platforms: Error: /home/kwanso/todo/platforms/android/cordova/build: Command failed with exit code 1 You may not have the required environment or OS to build this project Error: /home/kwanso/todo/platforms/android/cordova/build: Command failed with exit code 1 at ChildProcess.whenDone (/home/kwanso/.npm-packages/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
thanks
Did you update to new ionic
On Mon, Aug 31, 2015 at 10:56 AM, Ali Gardezi [email protected] wrote:
I am facing this problem. Can somebody help me out
error caught: Error: spawn EACCES /home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error: spawn EACCES at exports._errnoException (util.js:746:11) at ChildProcess.spawn (child_process.js:1162:11) at Object.exports.spawn (child_process.js:995:9) at module.exports (/home/kwanso/todo/platforms/android/cordova/lib/spawn.js:37:35) at /home/kwanso/todo/platforms/android/cordova/lib/build.js:343:24 at _fulfilled (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:760:13) at /home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:821:14 at flush (/home/kwanso/todo/platforms/android/cordova/node_modules/q/q.js:108:17) ERROR building one of the platforms: Error: /home/kwanso/todo/platforms/android/cordova/build: Command failed with exit code 1 You may not have the required environment or OS to build this project Error: /home/kwanso/todo/platforms/android/cordova/build: Command failed with exit code 1 at ChildProcess.whenDone (/home/kwanso/.npm-packages/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
thanks
— Reply to this email directly or view it on GitHub https://github.com/diegonetto/generator-ionic/issues/174#issuecomment-136397308 .
@faresallolo
this is what I'm using
Cordova CLI: 5.1.1 Ionic Version: 1.1.0 Ionic CLI Version: 1.6.4 Ionic App Lib Version: 0.3.8 OS: Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Node Version: v0.12.7
this came after running this command ionic build android (I am talking about the error which I have posted above)
Hi,
try update to latest Xcode then update to latest ionic .
Hi guys just give full permission to your android sdk directory recursively chmod 777 ~/android-sdk-linux
Thanks AsadAlihp You mean chmod +R 777 ~/android-sdk-linux? That's fixed it for me
Exactly ^^
On Wed, Mar 1, 2017 at 8:10 AM, Trevor Best [email protected] wrote:
Thanks AsadAlihp You mean chmod +R 777 ~/android-sdk-linux? That's fixed it for me
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/diegonetto/generator-ionic/issues/174#issuecomment-283335590, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSlRTGDnrP21zWWXsW-B_bRHDRhM5Gsks5rhW5hgaJpZM4DpkmN .
This is obviously for Android only. I discovered the --verbose flag, when I ran the plugin add command with it, the log showed each command as it was executed, turned out gradle.bat and gradlew in ~/git/ionic/myApp/platforms/android weren't executable, when I did a chmod a+x gradle*** in that directory the **cordova plugin add worked. Hope that helps
For me, it was a problem with <myproject>platform/android
. I just chmod -R 777
everything from there and worked just fine.