cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Bowser <bows...@gmail.com>
Subject Re: [Android] CB-8976, CB-8453 and is there anyone building multiple APKs
Date Wed, 02 Mar 2016 21:12:17 GMT
On Wed, Mar 2, 2016 at 1:07 PM, Carlos Santana <csantana23@gmail.com> wrote:

> First sorry for my stupid questions :-)
>
> Why do we need to mess with this versionCode?
>
>
Short Answer: We shouldn't have to.

Long Answer: We might need it for Crosswalk only.



> How a native developer creating a new Android App today using Android
> Studio and gradle handle this?
>

They set it in the Android Manifest like they're supposed to.  This hasn't
changed AFAIK.  Apparently having multiple APKs in the store means that you
have to have different version codes, although I haven't tested this yet.


> Should that help us determined how it should work for Cordova Apps?
>

You'd think, but then we wouldn't have this weird system in place right
now.  I wish we talked about this more, but this seems to have mostly flown
in under the radar when we were getting Cordova 4.0 out.


>
> Can we come with a similar system, or no system, or it's user space where
> they can put a version code they want to use in config.xml in conjunction
> with of the version string (i.e. 1.0.0) that they are already using in.
>
>
>
I believe that config.xml already does this, but we then munge it all up
because someone thought that we might want to have many APKs instead of
just one APK for a version of Android.  This is something that's pissed off
various developers over the past year, and the reason I'm asking is because
I want to see it deleted, but don't want to break anyone who relies on it.


>
>
>
> On Wed, Mar 2, 2016 at 3:58 PM Joe Bowser <bowserj@gmail.com> wrote:
>
> > OK, so, I'm dealing with this code, which pisses me off to no end:
> >
> >     if (Boolean.valueOf(cdvBuildMultipleApks)) {
> >         productFlavors {
> >             armv7 {
> >                 versionCode defaultConfig.versionCode + 2
> >                 ndk {
> >                     abiFilters "armeabi-v7a", ""
> >                 }
> >             }
> >             x86 {
> >                 versionCode defaultConfig.versionCode + 4
> >                 ndk {
> >                     abiFilters "x86", ""
> >                 }
> >             }
> >             all {
> >                 ndk {
> >                     abiFilters "all", ""
> >                 }
> >             }
> >         }
> >     } else if (!cdvVersionCode) {
> >       def minSdkVersion = cdvMinSdkVersion ?:
> > privateHelpers.extractIntFromManifest("minSdkVersion")
> >       // Vary versionCode by the two most common API levels:
> >       // 14 is ICS, which is the lowest API level for many apps.
> >       // 20 is Lollipop, which is the lowest API level for the updatable
> > system webview.
> >       if (minSdkVersion >= 20) {
> >         defaultConfig.versionCode += 9
> >       } else if (minSdkVersion >= 14) {
> >         defaultConfig.versionCode += 8
> >       }
> >     }
> >
> > So, right now if you're not using Crosswalk at all, your default version
> > code will be 18 instead of 1, and 28 for the second version if you aren't
> > using Crosswalk.  I can see why people would build multiple APKs per
> > architectures, but if you're building multiple APKs for different
> versions
> > of Android, we've all done something wrong and we never asked for this
> > feature to be added to Cordova.  The whole point of Cordova is to work
> > across multiple platforms, and that does include multiple versions of
> > Android.
> >
> > However, since this stupid code was added back in 4.0.x, I'm wondering if
> > anyone is relying on this code before I rip it out and have version codes
> > mean exactly what they're supposed to mean.  That means that when you
> build
> > and release your first app without using Crosswalk, your application
> > version code will be 1.  Not 18, not 19, but 1.  Then when you build
> > another version, that version will be 2, and so on.
> >
> > What do people think of this code going away?  Crosswalk will probably
> have
> > to have the different version codes, since I think us defining a system
> > could work better than leaving this up to the user and having things go
> > horribly sideways when people are trying to keep track of whether they
> > released an arm or x86 binary, since we already decided to take
> > responsibility for this.
> >
> > So, feedback on this would be good.
> >
> > On Thu, Feb 18, 2016 at 11:09 AM, Darryl Pogue <darryl@dpogue.ca> wrote:
> >
> > > Not intentionally on my end, but when I add the CrossWalk plugin I
> > > seem to get two APKs as output (one for armv7, one for x86).
> > >
> > > On 18 February 2016 at 11:05, Joe Bowser <bowserj@gmail.com> wrote:
> > > >
> > > > Hey
> > > >
> > > > Based on the feedback on those two issues, and other places, I think
> > that
> > > > most hated change from Cordova-Android 4.0 that we didn't fix in
> > > > Cordova-Android 5.0 was the fact that we have an undocumented way of
> > > > generating an arbitrary build number that makes absolutely no sense.
> > > > Furthermore, this screws up people's automated builds, and can cause
> > the
> > > > version code to reach MAX_INT.
> > > >
> > > > If you want to know why nobody has touched it until now, it's because
> > > > everyone hates working with Gradle.  I can say the exact same thing
> > about
> > > > why we're not using ProGuard.
> > > >
> > > > Now, I'm starting on my flensing of the gradle files that we have in
> > > here,
> > > > trying to figure out what we can rip out and I'm wondering if anyone
> is
> > > > actually using the multiple APK generation before I remove it. If
> > people
> > > > are, I'm going to have to figure out another way for this to happen,
> > > > because this is definitely breaking people's applications, and using
> > > random
> > > > hooks isn't a good answer.
> > > >
> > > > So, is anyone using this, or can this feature die!
> > > >
> > > > Joe
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > > For additional commands, e-mail: dev-help@cordova.apache.org
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message