I have some external libraries that are different versions to match all my build variants. In this example I have 4 different versions of the same library. I cannot figure out how to do this in my build.gradle file. I have two different flavors that combined with release and debug. In the example below, the commented out code works and the other code is what i'm trying to get working.
android {
buildTypes {
release {
minifyEnabled true
}
debug {
minifyEnabled false
}
}
flavorDimensions "base"
productFlavors {
flavor1 {
dimension "base"
applicationIdSuffix ".flavor1"
}
flavor2 {
dimension "base"
applicationIdSuffix ".flavor2"
}
}
}
dependencies {
// this works but cannot specify the build type
flavor1Implementation files('libs/mylib-release.aar')
// this combination of buildType+Flavor is not working
// flavor1ReleaseImplementation files('libs/mylib-flavor1-release.aar')
// flavor1DebugImplementation files('libs/mylib-flavor1-debug.aar')
// this works but cannot specify the build type
flavor2Implementation files('libs/mylib-flavor2-release.aar')
// flavor2ReleaseImplementation files('libs/mylib-flavor2-release.aar')
// flavor2DebugImplementation files('libs/mylib-flavor2-debug.aar')
}