Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap with Android-SDK 4.4

I'm running npm phonegap -g following this tutorial. Everything is fine, but when I run:

>cordova platform add android
>phonegap build android

I get this error:

[error] Please install Android target 17 (the Android 4.2 SDK). Make sure you
have the latest Android tools installed as well. Run `android` from your comman
d-line to install/update any missing SDKs or tools.

The Android SDK site is using Android 4.4 and API lvl Android 19.

How can I update NPM, PhoneGap, and Cordova to use the latest version of Android?

like image 683
user1207351 Avatar asked Mar 20 '26 17:03

user1207351


2 Answers

It's a cordova bug.

1- Replace android-17 for android-19 in android_parser.js file within the cordova module inside npm_modules of your node install.

2- Replace android-17 for android-19 in project.properties in your project.

Not a solution, just a workaround until Cordova release a fixed version.

like image 139
GermanDZ Avatar answered Mar 22 '26 12:03

GermanDZ


Change the value of "target" key in C:\Users\UserName\.cordova\lib\android\cordova\3.5.0\framework\project.properties to "android-20", this way:

target=android-20
like image 38
Sujoy Roy Chowdhury Avatar answered Mar 22 '26 13:03

Sujoy Roy Chowdhury



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!