This is what exactly i do :
$ phonegap create myapp
$ cd myapp
$ phonegap run android
but it fails.
I have checked everything. my environments are ok, installed the latest version. when i type
$ android
on my CMD it shows me that every latest updates are already installed but can not make it work :
$ phonegap run android
it returns :
^
Error: Please install Android target 19 (the Android newest SDK). Make sure you
have the latest Android tools installed as well. Run "android" from your command
-line to install/update any missing SDKs or tools.
at C:\Users\yeayea\.cordova\lib\android\cordova\3.3.0\bin\lib\check_reqs.js:
80:29
please help otherwise i will hang myself! :(
I had the same problem and I thought I had API 19 installed but I didn't.
In CMD type "android"
Scroll down to Android 4.2.2 (API 19)
Check all and install them.
Even if you already have API 20 installed and all the other packages and tools installed, you need this.
When you run phonegap create myApp
, there is a script which checks that you have a specific android platform version. The platform it is looking for is in the file (for OS X): /Users/username/.cordova/lib/android/cordova/3.5.0/framework/project.properties
and for Cordova 3.5.0 has the line:
target=android-19
Cordova and PhoneGap are the same in this regard so any reference to cordova also applies to phonegap.
To check that you have this target run:
android list targets
and you should have an entry like:
Available Android targets:
id: 1 or "android-19"
Name: Android 4.4.2
Type: Platform
API level: 19
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : default/armeabi-v7a
By default only the latest target is installed which is currently android-20.
You have two options:
To install an additional target, as Curtis said, run the Android SDK Manager (android
) and select the Android target you require. Note these appear below the Tools folder which also has a number of different versions, but installing a different version of the tools will not solve this problem.
You can also see the targets you have installed in the platforms directory of the Android sdk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With