Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova error building - EPERM, operation not permitted

I am trying to build an android APK file for my project

C:\myApp>cordova build android
cp: copyFileSync: could not write to dest file (code=EPERM):C:\myApp\platforms\android\res\xml\config.xml

Error: EPERM, operation not permitted 'C:\myApp\platforms\android\res\xml\config.xml'
at Object.fs.openSync (fs.js:438:18)
at Object.fs.writeFileSync (fs.js:977:15)

I used windows 7 64 Bit. What could be the reason?

My files by the way are versioned by subversion and I am not sure if that is the case.

Anyone encountered this one?

like image 282
Mark Estrada Avatar asked Nov 07 '14 07:11

Mark Estrada


4 Answers

Re-install android as a platform, should re-create any folders that had bad permissions

cordova platform remove android

cordova platform add android

like image 195
dansch Avatar answered Nov 19 '22 15:11

dansch


Try closing your code editor(ex: VS code)

and run/build again.

I know this is a strange fix but this solution worked for me.

like image 40
RRR Avatar answered Sep 24 '22 01:09

RRR


I had the same problem. This fixed the issue:

sudo chown -R yourUserName foldername
like image 10
Ahmad Mousavi Avatar answered Nov 19 '22 17:11

Ahmad Mousavi


Start Menu -> search "cmd" -> right click "cmd.exe" and "Run as administrator"

Fixed the issue for me.

like image 3
d3c0y Avatar answered Nov 19 '22 17:11

d3c0y