Cordova-CLI & PhoneGap-CLI do not see android sdk
Asked Answered
U

5

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?

Unquestioned answered 17/7, 2013 at 19:36 Comment(0)
C
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.

Culbertson answered 28/8, 2013 at 1:31 Comment(0)
E
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 ..

Enquire answered 24/7, 2013 at 8:22 Comment(1)
thanks, I found out that my problem was in missing JDK and Ant.Unquestioned
A
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://mcmap.net/q/843522/-phonegap-getting-started-with-android-quot-missing-one-of-the-following-quot

Antiquity answered 4/12, 2013 at 14:44 Comment(0)
B
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.

Bosket answered 11/12, 2013 at 14:9 Comment(0)
H
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;

Haemal answered 27/1, 2014 at 9:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.