Skip to content Skip to sidebar Skip to footer

Cordova Phonegap - How To Use Android API Level 21

Hey I forked the push notification plugin (https://github.com/alexislg2/PushPlugin) and added it to my project. The project won't compile with cordova build because I have a error:

Solution 1:

This is the progress of Cordova updating to android-21, android platform plugin v4.0 will support lollipop: https://issues.apache.org/jira/browse/CB-8026

There is an issue about cookie and a temporary workaround: http://tol8.blogspot.ca/2014/11/fixed-apps-cordovaphonegap-targeting.html

I would suggest waiting for the next version, looks like 3.7.1 also updated the target api level.

I am not using cookie related feature in my project, so I just replaced "android-19" with "android-21" in

platforms/android/CordovaLib/project.properties

And adds preference in config.xml

<platform name="android">
    <preference name="android-targetSdkVersion" value="21" />
</platform>

Another workaround (but ugly) is change the system cache of android plugin code:

~/.cordova/lib/npm_cache/cordova-android/3.6.4/package/framework/project.properties

---- Update ----

A better way of updating platform plugin will added in Cordova 4.2.1 (currently 4.1.2): https://issues.apache.org/jira/browse/CB-8239

$ cordova platform add <URL>

Post a Comment for "Cordova Phonegap - How To Use Android API Level 21"