Finally after years Google have added a default flavour option https://issuetracker.google.com/issues/36988145
We should use it to make contributing the project easier.
@mhutti1 Yes, sounds urgent, considering the number of youg people lost at their first compilation attempt.
@mhutti1 @macgills I think you have implemented this already. Closing the ticket. Duplicate of #886
I don't think we have, its not a duplicate AFAIK.
I'll have a go at it if that's okay
@mhutti1 The documentation of 2.5 says "debug" is the default, cf. https://github.com/kiwix/kiwix-android/blob/macgills/2.5-kotlin/CONTRIBUTING.md
In 2.5 we don't even need to specify it because we are not changing the default behaviour. This is done and will soon enough be propagated to the rest of the project, closing
I am talking about the default build that is loaded into android studio. This has always been alphabetical in the past. I still don't think this has been fixed. Can you point to me to the gradlew code with the change?
By default, Android Studio builds the debug version of your app, which is intended only for use during development, when you click Run.
https://developer.android.com/studio/run Maybe we are talking about different things here because I am not really following you
Yes it chooses debug but it chooses the custom app debug version. It should be choosing the normal version.
Does it? I don't think it did for me ever.
It is very strange because it is acting like a flavour without ever being defined as such, I guess because it has it's own build.gradle? This is very much unchartered territory for me.
this feature will be in Android Studio 3.5. NO JOKE - this took 5 years to implement !! (look at the ticket creation date) – Someone Somewhere May 17 at 12:57
Regardless this feature is not available to us yet if this SO-er is to be believed but now I do understand what is being said and do agree that it should be defined
@mhutti1 @macgills Re-opening ticket.
@kelson42 Android Studio 3.5 is still not out in the stable channel, recommend pushing this to 3.1.
Hopefully it will be soon as 3.4.2 was in July
@kelson42 @macgills so @mhutti1 had told me to do this once 3.5 is out in a couple of months, I can take it off your hands then if you like
Android Studio 3.5 has a stable release now, I'll get to this
The AOSP gradle plug-in implementation might still be a little buggy, because despite numerous attempts with release marked as the default build-type, it's still picking debug (customExampleDebug) as the default build-variant. Other users have asked for clarifications as well.
I've asked for confirmation on the tracker if it is actually working for someone since it has been available last week. Should yield a fix in case there's something wrong with my syntax.
debugKiwix is meant to be the default variant.
Note that this only affects the initial import of the project, Studio will remember locally which variant was selected after that.
you are re-importing the project each time? If we can mark the flavor isDefault=true and that actually works that would be cool
you are re-importing the project each time?
Yes - in fact I cloned a new copy of the repo (in a new location) every time and imported it to avoid having Studio use the build-variant used in the previous import (if that's possible).
If we can mark the flavor isDefault=true and that actually works that would be cool
It's supposed to pick the build-type marked with isDefault = true (syntax for selecting a flavour hasn't been explicitly specified yet). So it should be selecting release instead of debug (selecting debug build type, if present, is the default behaviour now). But since it doesn't I'm waiting for any sort of confirmation on the tracker that it actually works.
if it doesn't select flavour then it is useless to us as it already defaults to debug. We don't want it to be release
@macgills the AOSP commit says it's supposed to allow setting of a default variant. Maybe they'll fix it soon - It only got available last week I think, with Studio 3.5's release
Yup, lets hope
I think it no longer makes sense to have this in the 3.0 milestone, moving to 3.1
The confusion should no longer exist because of modularisation. The App module doesn't have buildFlavors anymore, only buildTypes debug/release. I would say this is all fairly self explanatory now so I will close this ticket
@macgills If documentation is updated, good to me
Yup, it was
Most helpful comment
Android Studio 3.5 has a stable release now, I'll get to this