Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova 3.5 plugin permission error(rm: could not remove file (code EACCES)

Tags:

cordova

This is my first time i'm using cordova and phonegap. I have tried the two and none of them is working for me. For phonegap latest documentation, you don't need to install some plugins they are already bundle with it. Like the device,contact,network-information and from the android configuration permissions are already been given to them.

And the problem i have with cordova 3.5(latest) is when i install plugin and try to build or run i have permission problem and if i give the plugin directory a permission then these error pop up

   rm: could not remove file (code EACCES):    /home/bright/helloTest/platforms/android/assets/www/cordova.js

  rm: could not remove file (code EACCES):  /home/bright/helloTest/platforms/android/assets/www/cordova.js
  rm: could not remove file (code EACCES): /home/bright/helloTest/platforms/android/assets/www/cordova_plugins.js

  rm: could not remove file (code EACCES): /home/bright/helloTest/platforms/android/assets/www/cordova.js
  rm: could not remove file (code EACCES): /home/bright/helloTest/platforms/android/assets/www/cordova_plugins.js
  rm: could not remove file (code EACCES): /home/bright/helloTest/platforms/android/assets/www/css/index.css

And if run or build with root permission i get this error:

  Running command: /home/bright/helloTest/platforms/android/cordova/run 
  ERROR: Error: ERROR : executing command 'ant', make sure you have ant installed and added to  your path.
  Error: /home/bright/helloTest/platforms/android/cordova/run: Command failed with exit  code 2
  at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-  lib/src/cordova/superspawn.js:135:23)
  at ChildProcess.EventEmitter.emit (events.js:98:17)
  at maybeClose (child_process.js:753:16)
  at Process.ChildProcess._handle.onexit (child_process.js:820:5)

but when no plugin is install it runs perfectly. I'm using ubuntu 12.04.

And why is the phonegap(latest) plugins not working, i mean the default APIs(contact,geolocation,device,network-information,notification and the rest)

I would be grateful if point me on right path, i spent great deal of time on this issue for days trying to make this work. Thank You in advance,

like image 493
Bright Avatar asked Jul 29 '14 11:07

Bright


1 Answers

Just run in root project via terminal:

sudo chown username * -R

If not works, run:

sudo chmod +777 -R

*username = your username in OS

like image 148
Richelly Italo Avatar answered Sep 28 '22 06:09

Richelly Italo