5

I've created app with "phonegap create" command. Then I switch to project dir and try to run it with "phonegap local run android" and I have next error message:

Please install Android target 17 <...>

Android SDK is placed to C:\dev\sdk My PATH variable contains C:\dev\sdk; C:\div\sdk\platforms\;C:\dev\sdk\platform-tools I run "android" command from cmd and SDK Manager shows no updates or no missed sdk files. I tried create and run project with cordova cli but had same problem. What can it be?

5 Answers 5

7

It seems that for latest Cordova (3.0.6),

cordova platform add android

command only recognize Android 4.2.2(API17) SDK. After I install the API17 SDK, the error was gone. Not sure if there is a cordova command option that can specify SDK version.

5

I had just the same problem (error message) with os x (10.8). After executing the command android in the Terminal some android-packet-management-UI popped up. There i could install stuff that made it run ..

1
  • thanks, I found out that my problem was in missing JDK and Ant. Commented Jul 25, 2013 at 15:49
1

I had API17 installed but was still getting this error.

I needed to install apache-ant, set ANT_HOME=C:\Program Files\Java\apache-ant\, JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21\ and add both bin's to my PATH += C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\apache-ant\bin

See https://stackoverflow.com/a/13986997/956397

0

I had the same problem and the very most simple way to resolve it is changing the target in project.properties to 16 and try.

0

it seems if you type "android" at the same command prompt you type your cordova commands, you get a separate Android SDK manager then the one launched via Eclipse and so then there you select the appropriate packages and updates to achieve the version number of the Adroid SDK required. For me I'm guessing it's from an adt-bundle I installed with _? (I don't know actually no clue) that runs instead. My best guess is the installer when updating doesn't doesn't update the path correctly.

Ya you need to manually correct duplicates and anomalies in the path. Point to the "sdk" folder and tools of a valid most current adt-bundle-windows folder. Maybe it was NetBeans that did this? No it seems plausible when I put an update of Eclipse (C:\Library\Dev\Android\adt-bundle-windows-*) I must have not realized I needed to update the path too having done it manually the first time to get it to work.

It seems I needed plateform-tools added as well for adb to run the emulate command...

C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools;

Not the answer you're looking for? Browse other questions tagged or ask your own question.