anomepani
anomepani

Reputation: 1846

Phonegap 3.0 CLI issue in run app for Android platform

While creating a Phonegap app using the Phonegap command line for the Android platform, I have run in command prompt like below:

C:\PhoneGapCL> phonegap create helloworld
C:\PhoneGapCL>  cd helloworld
C:\PhoneGapCL\helloworld>phonegap local run android

And I got the following error:

[phonegap] adding the Android platform...
[error] The command android failed. Make sure you have the latest Android S
DK installed, and the android command (inside the tools/ folder) added to your
path. Output: 'android' is not recognized as an internal or external command,
operable program or batch file.

Upvotes: 3

Views: 4228

Answers (4)

Zain
Zain

Reputation: 43

There is an issue with using API 18 of the Android SDK with PhoneGap. Using the Android SDK manager, download and install API 17. That should solve the problem. (Get rid of API 18 if it still doesn't work).

Upvotes: 0

Tony
Tony

Reputation: 1463

If you are sure that your PATH is set correctly and you still get this, try this.

Open Android SDK Manager and make sure to fully download latest Android API (for this moment it is API 18), then get all items from Tools and all items from Extras.

This solved this issue for me.

Upvotes: 0

Arwin Abatayo
Arwin Abatayo

Reputation: 1

Try this: export PATH=${PATH}:/Users/myusername/path/to/android/sdk/platform-tools:/Users/myusername/path/to/android/sdk/tools:$JAVA_HOME/bin:$ANT_HOME/bin

Use the whole absolute path of your folder. Hope it helps.

I'm actually dealing with this error now

[error] An error occured during creation of android sub-project. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY >&/dev/null exited with 1
Deleting project...

Upvotes: 0

user1952312
user1952312

Reputation: 258

Try typing which android is if this does show /path/to/android then you need to set you path by PATH=$PATH:/path/to/android/platform-tools:/path/to/android/tools hope this helps

Upvotes: 3

Related Questions