Reputation: 157
i am new to phonegap 3 and android development.
i tried the command "phonegap build android" and get:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project.
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory 'C:\Users\Michael\.cordova\lib\android\
cordova\3.1.0\VERSION'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at Object.exports.createProject (C:\Users\Michael\.cordova\lib\android\cordo
va\3.1.0\bin\lib\create.js:116:22)
at Object.<anonymous> (C:\Users\Michael\.cordova\lib\android\cordova\3.1.0\b
in\create:34:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
Upvotes: 2
Views: 7650
Reputation: 3636
I have removed android platform and added again.
cordova platform rm android cordova platform add android
then, cordova prepare android
is done without errors
Upvotes: 0
Reputation: 489
I simply add an empty file named as VERSION:
C:\Users\myuser\.cordova\lib\android\cordova\3.1.0\VERSION
after, I wrote this text inside it:
3.1.0
after, run phonegap again:
[phonegap] adding the Android platform...
[phonegap] compiling Android...
[phonegap] successfully compiled Android app
Good luck!
Upvotes: 3
Reputation: 1932
I would suggest as a bare minimum first step you should check via the command line that the following commands return a response that shows they are working correctly. They are all required. Ant - http://ant.apache.org/
android - http://developer.android.com/sdk/index.html
In command line type the following to validate they work
Ant
java
android
Make sure you have node.js installed (http://nodejs.org/) Also make sure you look at you PATH file and that everything is correct there.
As I say that's the basics (once you have stuff installed)
Upvotes: 1
Reputation: 1505
It is kind of tricky This is the sequence I have to go through.
Upvotes: 1
Reputation: 9374
Try to install latest cordova. Maybe it will help:
$ sudo npm install -g cordova
(also you will need node.js installed)
Upvotes: 0