I'm looking for something like
apply plugin: 'android-library'
dependencies {
flavor1Compile files('utility.aar')
}
Everything fails with:
Could not find method flavor1Compile() for arguments [file collection] on root project 'SampleProject'.
void missingDimensionStrategy ( String dimension, String requestedValue) Specifies a flavor that the plugin should try to use from a given dimension in a dependency. Android plugin 3.0. 0 and higher try to match each variant of your module with the same one from its dependencies.
Flavor Dimensions is a way to group flavors by a name. For now, we're using just a single group. Add the following line in your defaultConfig block: flavorDimensions "default" Now syncing the gradle would give you the following product flavors: Android Build Variants combine build types and product flavors.
So minifyEnabled removes dead code but does not obfuscate or optimize.
Libraries don't support flavors.
Note that this wouldn't work in a app project because you haven't defined the flavor first. You'd need to do
android {
productFlavors {
flavor1 {}
}
}
dependencies {
flavor1Compile ...
}
it wouldn't work in the other order as declaring the product flavor is what create its associated dependency configuration.
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