Reputation: 21
Having these flavors defined:
flavorDimensions "env", "type"
productFlavors {
new{
dimension "type"
...
}
legacy{
dimension "type"
...
}
staging {
dimension "env"
...
}
prod {
dimension "env"
...
}
Is it possible in some way ask gradle to "assembleStaging" assuming that the default "type" dimension is "legacy"?
Upvotes: 1
Views: 698
Reputation: 1559
I faced the same issue and I resolved it by using like this
flavorDimensions "type"
productFlavors {
new{
dimension "type"
...
}
legacy{
dimension "type"
...
}
staging {
dimension "type"
...
}
prod {
dimension "type"
...
}
You have to pass same dimension for each flavors.
When you write code in your main directory it'll common for all your flavors, you can write flavors related code in flavors directory. For creating specific flavors debug build you can change it from Build Variants option at left bottom corner, for creating release build their is option appears for target flavors after entering your jks signing related details.
Upvotes: 2