cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikhil Khandelwal <>
Subject RE: [Android] 5.0.x release branch?
Date Wed, 23 Sep 2015 00:57:35 GMT
Thanks, Joe for the detailed explanation. I understand why we've taken this route. It's good
that this is only a build failure. One of the complaints we commonly hear from Cordova developers
is that "I have a cordova project with a certain version of the platform, I need to find the
plugin that will work with it". Our CLI always defaults to add the latest released version
of the plugin.

After this breaking change, an existing cordova project with cordova-android < 5.x, cannot
build with the latest version of the following plugins:
                - camera
               - geolocation
               - contacts.
These are some of the most popular plugins in cordova plugin ecosystem [1].

I propose that we should do our best to avoid disruptive breaking changes here. Some ideas
that come to mind:
- As Joe mentioned below - reflection. It has the downsides that Joe mentioned. No one likes
to write code like this it but results in least grief for Cordova users. Some pain here for
plugin developers will simplify the experience for large number of corodva JS developers.
I know we are doing some of this in cordova-ios [2] and would love to find ways on how to
make this manageable and not super ugly.
- Add an  '<engine name="cordova-android" version=">=5.0.0" /> '  to the plugins
- failure happens at plugin add in this scenario. Cordova-lib could be more intelligent to
detect this error and resort to using an older version of the plugin. The downside of this
is that these projects cannot use the latest and greatest of these plugins. 




-----Original Message-----
From: Joe Bowser [] 
Sent: Monday, September 21, 2015 6:32 PM
Subject: Re: [Android] 5.0.x release branch?

On Mon, Sep 21, 2015 at 5:43 PM Nikhil Khandelwal <>

> Can you explain why latest plugins will not be compatible with older 
> versions of Cordova?

They won't be compatible because Cordova-Android compiles against API 22, and these plugins
will require API 23 so that they can detect permissions and support Marshmellow.

> Can this be avoided by any means?

Only with a lot of Java reflection, and I'd rather not subject plugin developers to that,
or try to hide it under the hood in some awful utility class that everyone will want to see
die.  I'm very much a fan of if statements because they work, and they're easy to read and
debug, unlike when bad things happen to things you reflect into.  Plugins that require API
23 will only work with Cordova-Android 5.0 and up.  This only impacts five of our core plugins,
but any plugin that requires permissions from the Android Manifest will have to be updated.
 If we can avoid using advanced language tricks to make the APKs compatible, we should do

When you mean they would not be compatible - will it result in a build or
> runtime failure?
This will be a build failure, since API 22 does not have these permissions, nor does it have
the code required for API 23.

> For marshmallow, what is the guidance that we need to issue to the 
> larger Cordova plugin ecosystem? Joe you are ahead of the curve here 
> compared to most other plugin developers - a blot post explaining what 
> are known gotchas would be great. I really hope we can use our Cordova 
> blog to communicate these changes actively to the plugin ecosystem. 
> This mailing list only gets 400+ subscribers.
There will be a blog post once 5.0 is released.  We're not forcing people to upgrade to 5.0,
and we will be supporting the 4.x branch for six months.  This does mean we're stuck supporting
3.x, 4.x and 5.x for a brief window, but I have no control over when Marshmallow is released,
only whether we want to support it or not.  I think we do, but I could be wrong.

At least this should be easier than the jump from 3.x to 4.x for most people, but the alternative
is that your plugin just doesn't work at all on Marshmallow.  We need to at least give plugin
developers this option, since it'll roll out on all the Nexus devices in the next two weeks,
and we'll hear more about it.

> Can you re-base your cordova-android over the current master? It's 
> hard to see a diff in the current form:
> s&
> edb23c%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=j0bxz39itXdtylHJlv
> PYoJpZqXMhFjyTV35I9X5Yxzs%3d
I had to do a merge commit to get this to happen (boo), but it should be mostly cleaned up
now.  It seems some style cleanup creeped into the most recent changes, but this should be
a bit more readable.

> -Nikhil
> -----Original Message-----
> From: Joe Bowser []
> Sent: Monday, September 21, 2015 2:14 PM
> To: dev <>
> Subject: [Android] 5.0.x release branch?
> Hey
> In the next two weeks, Marshmallow will most likely getting released 
> with the brand new Nexus 6P being released from Huawei.  Given that 
> most of the Nexus devices will be getting this release, we should 
> probably release the 5.0.x branch of Android soon, and get the new plugins updated.
> It should be noted that the latest plugins will not be compatible with 
> older versions of Cordova, which is a big deal.  This is due to the 
> use of various compatibility checks to make sure they support 
> Marshmallow and older versions of Android.
> So, if everyone can look over the smores branches of my GitHub before 
> I create the 5.0.x branch and pull the changes into it, that would be awesome.
> 41af91ab2d7cd011db47%7c1&sdata=%2fPKmL8KTsz5dnC3A75yMatXLQUnfK0Nv07%2b
> ve4PVcCE%3d
> 2f988bf86f141af91ab2d7cd011db47%7c1&sdata=o6cLXM4f3kpUGCTlIv65ft8lKv6p
> c5qbeY%2bdUxiP4bc%3d
> bf86f141af91ab2d7cd011db47%7c1&sdata=kNsHIv6Uw2ITcT1ABmNq1JCmPTSigCGRb
> 4zWC8maWpE%3d
> 88bf86f141af91ab2d7cd011db47%7c1&sdata=rZ%2f1AALPAtUwgSXyOL1uk1b0Y%2fe
> EmqLOdU%2fwua2TbLU%3d
> Work on audio is still outstanding, BUT for some reason Audio broke 
> recently on both Lollipop and Marshmallow.  I didn't test it out on 
> KitKat or Jellybean yet, but I'm wondering whether we should keep 
> maintaining this or support the standard HTML5 audio and deal with the 
> asset issue somehow (which isn't straight forward).
> I hopefully want to get a 5.0.x branch happening this week if we can.
> What do people think?
> Joe
View raw message