Reputation: 2483
I am new to phonegap. I already have ADT in my PC.
1)I installed NodeJs.
2)I wrote on cmd
npm install -g phonegap
phonegap create my-app
cd my-app
phonegap run android
[phonegap]detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] No platforms added to this project. Please use 'cordova platform add <platform>'.
Here I already set the correct PATH. But the same problem occurring. If anyone knows plz let me know. Thnx
Still not working .. Can anybody knows this .. Plz .. Thanks in advance..
I added these path for android: -
D:\adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\platform-tools\
D:\adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\tools\
and Java path is already set here.. So What's the problem here.. anyone can give the solution plz
Upvotes: 0
Views: 11317
Reputation: 11
For Mac just add the cordova path :
export PATH=$PATH:/usr/local/lib/node_modules/phonegap/node_modules/cordova/bin:/usr/local/bin
now add platform like : cordova platform add android
the platform will be added.
Upvotes: 0
Reputation: 563
EDIT: THIS ANSWER USES CORDOVA, NOT PHONEGAP
You must tell cordova which platforms you are going to use (e.g. android)
therefore, before executing command $cordova run android
you must (once) execute cordova platform add android
For more details, see my answer here: Phonegap How to make android build
Regards, miweiss
Upvotes: 3
Reputation: 2483
At last I got the solution
Initially I wrote the command cordova platform add android
, Then it was showing the error :
No platforms added to this project. Please use 'cordova platform add <platform>'.
I did some changes:
I change it to cordova -d platform add android
I reset all path, reset means again set my JAVA_HOME path and ANT_HOME path and then I gave the command cordova -d platform add android
then it was again showing error like There is no script engine for file extension .js
. Then just use the command in commmand prompt assoc .js=JSFILE
and put the command on prompt cordova -d platform add android
and its done, now it contains android folder within platforms.
Thank You All for help
Upvotes: 2