Reputation: 13
here is the information shown in my commandline:
$ cordova platforms add android
Creating android project...
Error: ENOENT, no such file or directory 'C:\Users\Administrator\.cordova\lib\android\cordova\3.5.0\VERSION'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\platform.js:351:42
at _fulfilled (c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:760:13)
at c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:821:14
at flush (c:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
at Function.Module.runMain (module.js:499:11)
Upvotes: 1
Views: 788
Reputation: 11
When u create a project in cordova 3.5.0, version file in .cordova is missing. So unable to add android platform. I have copied version file from 3.4.0 and paste it to 3.5.0 with version change as 3.5.0. and with it, my issue is solved.
Upvotes: 1
Reputation: 303
SyntheCyphers answer worked for me after manually deleting the whole .cordova folder and then running cordova platform add android
in project folder.
Upvotes: 1
Reputation: 5394
First go to that path and see if the file it's looking for is indeed missing.
C:\Users\Administrator\.cordova\lib\android\cordova\3.5.0\VERSION
If it is then reinstall cordova using the following commands:
npm uninstall cordova -g
npm cache clean
npm install cordova -g
Then try again and see if you get the same error.
Upvotes: 4