I have a bunch of product flavors defined for my build. However in some scenarios I want to build without a flavor.
However when I try to build a release with no flavor, ie
gradlew assembleRelease
It goes through and builds all of the variants, which takes a really long time. I would like to kick off a release build and ignore all flavors. Is that possible?
I am sure I could add an empty flavor called 'default, and build that. Seems like I should not have to do that.
EDIT:
defaultConfig {
resValue "string", "hello", "Hello default"
}
productFlavors {
foo {
resValue "string", "hello", "Hello Foo"
}
bar {
resValue "string", "hello", "Hello Bar"
}
}
Seems the answer at the moment is to provide your own 'default' flavor
productFlavors {
defaults {
// yup its empty cause I just want to build with the defaults
// that are already defined.
}
foo {
resValue "string", "hello", "Hello Foo"
}
bar {
resValue "string", "hello", "Hello Bar"
}
}
Build variants are the result of Gradle using a specific set of rules to combine settings, code, and resources configured in your build types and product flavors. Although you do not configure build variants directly, you do configure the build types and product flavors that form them.
To change the build variant Android Studio uses, select Build > Select Build Variant in the menu bar. For projects without native/C++ code, the Build Variants panel has two columns: Module and Active Build Variant.
NOTE: By default, the Android Studio will generate "debug" and "release" Build Types for your project. So, to change a Build Type, all you need to do is just select your Build Type from the Build Variant and after the project sync, you are good to go.
I found out that "main" as a flavor works. So i dont need to add an additional folder with google-services.json or anything in it
productFlavors {
main{
}
flav1 {
applicationId 'id'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With