Helo, I am currently trying to build the base phonegapp android app that's automatically created, so I navigated to the directory... but when I use the command
phonegap build android
I just get this random error, as shown in the attatched picture.
Extra info
I am currently on Windows 8, and am completely new to making apps, and am new to the command line as well. Not very familiar with this stuff...
What I'm trying to do would be called 'compiling', right?
Yeah, I had the same problem yesterday - but with a little help of a colleague I got it!
Step by step tutorial (for Windows)
npm install -g phonegap
ANDROID_HOME
which points to destination of Android SDK. e.g. C:\Users\You\AppData\Local\Android\android-sdkANT_HOME
which points to destination where you have extracted AntJAVA_HOME
which points to destination of JDKPATH
environment variable:%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin
Setting environment variables will take effect just for new command line windows. So you should reopen it, after the whole process.
Easy, isn't it? ;-)
Now you can use
phonegap build android
after you've created a new phonegap project. If you have your smartphone plugged via USB and installed the USB drivers, and activated the USB Debugging on smartphone, you may usephonegap run android
And the ready build APK will be transfered and executed on your smartphone. Perfect for testing.
If you want to create a final release APK, go to
YOURPROJECT\platforms\android\ant-build
and enterant release
. You'll find the final APKs inYOURPROJECT\platforms\android\bin
.They are unsigned, here is a Noob guide to signing an APK.
I have tested a Barcode Scanner example, and it works seamlessly.
Have fun!
Armin's guide is perfect. But if you still fail you can do this. Phonegap platform files stay in C:\Users[username].cordova\lib folder. Go there and remove android/ios/bb... driectory.
For best result run this command:
After that try again, clean platfrom files will be download and build your project.
also check
android
incmd
, if it says:'xcopy' was not recognized
.then add to your path: