Status Update
Comments
tn...@google.com <tn...@google.com>
xa...@android.com <xa...@android.com> #2
xa...@android.com <xa...@android.com> #3
co...@gmail.com <co...@gmail.com> #4
dr...@gmail.com <dr...@gmail.com> #5
MacOs Sierra 10.12.6
Android Studio 2.3.3
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
xa...@android.com <xa...@android.com>
sj...@gmail.com <sj...@gmail.com> #6
lu...@actusmobile.com <lu...@actusmobile.com> #7
2d...@gmail.com <2d...@gmail.com> #8
th...@gmail.com <th...@gmail.com> #9
Something like the "isDefault" option showed below would be grand:
flavorDimensions "client", "environment"
productFlavors {
client1 {
dimension "client"
applicationId 'com.company.project.client1'
isDefault true
}
client1dev {
dimension "environment"
isDefault true
}
}
lo...@gmail.com <lo...@gmail.com> #10
Please, could you solve this issue in Android gradle plugin for Android Studio 2.3 release?
Thanks a lot!
en...@gmail.com <en...@gmail.com> #11
je...@gmail.com <je...@gmail.com> #12
kk...@efir.uz <kk...@efir.uz> #13
Frequently, on GitHub, we see new comers opening issues asking for release build keys because the build is failing. Please, we need this.
ms...@vivino.com <ms...@vivino.com> #14
lo...@gmail.com <lo...@gmail.com> #15
mr...@gmail.com <mr...@gmail.com> #16
[Deleted User] <[Deleted User]> #17
ap...@gmail.com <ap...@gmail.com> #18
So make everything work, now we defaulted to "fat" version, with "all-inclusive":
android {
flavorDimensions 'abi'
productFlavors {
fat {
dimension 'abi'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// , 'armeabi', 'mips' //obsolete
versionCode 0
}
}
}
sc...@gmail.com <sc...@gmail.com> #19
[Deleted User] <[Deleted User]> #20
if...@gmail.com <if...@gmail.com> #21
New developers are having problems since Android Studio selects the first variant in the list which is not what we typically use for development.
ki...@yandex-team.ru <ki...@yandex-team.ru> #22
rm...@alephom.com <rm...@alephom.com> #23
eu...@paulo.costa.nom.br <eu...@paulo.costa.nom.br> #24
ss...@bostondynamics.com <ss...@bostondynamics.com> #25
ll...@gmail.com <ll...@gmail.com> #26
[Deleted User] <[Deleted User]> #27
ha...@gmail.com <ha...@gmail.com> #28
al...@gmail.com <al...@gmail.com> #29
mi...@gmail.com <mi...@gmail.com> #30
um...@canva.com <um...@canva.com> #31
th...@canva.com <th...@canva.com> #32
xu...@gmail.com <xu...@gmail.com> #33
je...@google.com <je...@google.com>
am...@instant-system.com <am...@instant-system.com> #34
[Deleted User] <[Deleted User]> #35
li...@gmail.com <li...@gmail.com> #36
jk...@shift4.com <jk...@shift4.com> #37
[Deleted User] <[Deleted User]> #38
ga...@gmail.com <ga...@gmail.com> #39
[Deleted User] <[Deleted User]> #40
ru...@gmail.com <ru...@gmail.com> #41
te...@gmail.com <te...@gmail.com> #42
cm...@google.com <cm...@google.com> #43
ne...@gmail.com <ne...@gmail.com> #44
example:
We already used this approach to speed up project configuradtion and synchronization.
If there is only one variant lefr, Android studio does not have another options and chooses it )
st...@naimaudio.com <st...@naimaudio.com> #45
And where is the 'me too!' button? I can see that.
ne...@gmail.com <ne...@gmail.com> #46
cm...@google.com <cm...@google.com> #47
st...@naimaudio.com <st...@naimaudio.com> #48
edit: Obviously I can write a script to edit the properties file, but if there is a better option I would sooner use that.
ne...@gmail.com <ne...@gmail.com> #49
if you keep your gradle.propertes file in VCS you can create `local.properties` file and read this property from it.
ne...@gmail.com <ne...@gmail.com> #50
st...@naimaudio.com <st...@naimaudio.com> #51
I can see adding a local.properties to the CI environment that sets to an empty value though. That could work.
ne...@gmail.com <ne...@gmail.com> #52
if (forceBuildVariant && isCiServer) {
variantFilter {
...
}
it will work out-of-the-box for CI and for new developers.
In my example I told, that it is only a workaround to solve this problem but not a really production solution.
st...@naimaudio.com <st...@naimaudio.com> #53
Thanks for the example!
ne...@gmail.com <ne...@gmail.com> #54
st...@naimaudio.com <st...@naimaudio.com> #55
st...@gmail.com <st...@gmail.com> #57
if(properties.containsKey('android.injected.invoked.from.ide')) {
//use filter variant here.
}
Of course, this workaround also has limitations and doesn't work for all projects.
the workaround was inspired from butterknife reflect:
ki...@gmail.com <ki...@gmail.com> #58
I also used the above workaround successfully to exclude our offending BuildVariant in Android Studio.
For later versions of Android Studio:
cm...@google.com <cm...@google.com> #59
Which should be included in Android Gradle Plugin 3.5.0-alpha08 and Android Studio 3.5 Canary 8 [3.5.0.7].
The heuristic for projects using older AGP and projects without explicit settings has also been updated to favour variants with the build type debug, as described in the commit message.
t....@gmail.com <t....@gmail.com> #60
cm...@google.com <cm...@google.com>
xa...@google.com <xa...@google.com>
cm...@google.com <cm...@google.com>
go...@yandex-team.ru <go...@yandex-team.ru> #61
I can't set this value with Gradle DSL.
all of these options don't work:
`isDefault true`
`default true`
`'default' true`
`setDefault true`
cm...@google.com <cm...@google.com> #62
android {
buildTypes {
dev { isDefault = true }
}
}
Note that this only affects the initial import of the project, Studio will remember locally which variant was selected after that.
[Deleted User] <[Deleted User]> #63
Is this DSL available in Android Gradle Plugin 3.5.0 and Android Studio 3.5:
android {
buildTypes {
dev { isDefault = true }
}
}
di...@gmail.com <di...@gmail.com> #64
ne...@gmail.com <ne...@gmail.com> #65
android {
buildTypes {
dev {
isDefault = true
minifyEnabled false
}
}
}
First of all it's not needed to use = between name and value of other parameters.
Secondary "is" usually not used in Boolean properties by conversion.
sl...@gmail.com <sl...@gmail.com> #66
ne...@gmail.com <ne...@gmail.com> #67
cm...@google.com <cm...@google.com> #68
Filed
For (2): Default is a java keyword, but all other names seemed worse than adding an is prefix.
so...@gmail.com <so...@gmail.com> #69
My project is still defaulting to the alphabetically first build-type in initial imports even though another type has been marked as default.
je...@gmail.com <je...@gmail.com> #70
android {
buildTypes {
dev {
isDefault = true
}
}
}
gives me "Access to 'isDefault' exceeds is access rights". If I look at the BuildType class I see that isDefault is final and no setter is present.
Android Studio: 3.5
Gradle plugin: 3.5.0
cm...@google.com <cm...@google.com> #71
za...@gmail.com <za...@gmail.com> #73
Tested on build tools 3.5.1 and only on initial project import as this is what I need.
di...@gmail.com <di...@gmail.com> #74
```
flavorDimensions "custom_dimensions"
productFlavors {
my_flavor_name {
isDefault.set(true) // set my_flavor_name flavor as default
dimension "custom_dimensions"
// other code
}
```
fr...@gmail.com <fr...@gmail.com> #75
Let's say I have two variants, A and B. I've specified A as the "default" using this scheme.
Then, I switch to B. If I do anything that results an a gradle sync, it reverts back to variant
A, but I'd rather it stay on B. This is while using Android Studio 3.5.1. I haven't quit
the app or closed the project.
ge...@gmail.com <ge...@gmail.com> #76
[Deleted User] <[Deleted User]> #77
cm...@google.com <cm...@google.com> #78
The supported DSL is
android {
buildTypes {
dev {
isDefault = true
}
}
}
v....@gmail.com <v....@gmail.com> #79
cm...@google.com <cm...@google.com> #80
Then equivalently
android {
productFlavors {
foo {
isDefault = true
}
}
}
gi...@gmail.com <gi...@gmail.com> #81
Watch out if you use initWith(...)
, then this property is copied, too.
Maybe something like this would prevent having multiple defaults:
android {
defaultVariant = "variantName"
}
ba...@gmail.com <ba...@gmail.com> #82
cm...@google.com <cm...@google.com> #83
re #81 - filed
[Deleted User] <[Deleted User]> #84
re #82, I only get that if I use:
android {
productFlavors {
foo {
isDefault = true
}
}
}
If I omit the =
and use:
android {
productFlavors {
foo {
isDefault true # or isDefault.set(true)
}
}
}
I do not get that warning.
tu...@gmail.com <tu...@gmail.com> #85
I use Android studio 3.6.2 with gradle plugin 3.6.2
I tried to restart android studio with full rebuild bot it still doesn't work
Any suggestions?
cm...@google.com <cm...@google.com> #86
#85 Please file a new issue with exactly what you did, what you expected to happen and what did actually happen.
tu...@gmail.com <tu...@gmail.com> #87
Thank you and sorry for my question. Hope my story can help somebody!
ca...@gmail.com <ca...@gmail.com> #88
* Preferences > Experimental > Only sync the active variant
Otherwise, it always fallbacks to the first build variant (alphabetically).
Is this the intended behavior?
cm...@google.com <cm...@google.com> #89
#88 please file a new issue including the
ca...@gmail.com <ca...@gmail.com> #90
Done on
Description
The way I had imagined it work was to specify a build variant as the default via a defaultVariant task similar to below:
Examples
1- No Flavors
defaultVariant {
buildType = "debug" // or "release"
}
2- Flavors
defaultVariant {
buildType = "debug" // or "release" or "whatever"
productFlavor = "free" // or "paid" or "adsupport"
}
3- Multi-dimensional Flavors (with groups ping {a,b,c} & pong {d,e,f,g})
defaultVariant {
buildType = "debug" // or "release" or "whatever"
productFlavor = "free" // or "paid" or "adsupport"
ping = "a" // or "b" or "c"
pong = "f" // or "d" or "e", or "g"
}
Thank you guys for a great system. Implementing what I currently have in gradle would have been next to impossible with the old system.