我有自定义图书馆的口味"水"和"蓝" :
flavorDimensions "water", "blue"
productFlavors
{
water
{
flavorDimensions "water"
}
blue
{
flavorDimensions "blue"
}
}
configurations
{
waterDebugCompile
waterReleaseCompile
blueDebugCompile
blueReleaseCompile
}
两者都覆盖来自" main"的TestA.class。文件夹
TestA.class from "main" has a method that toast "MAIN"
TestA.class from "water" => "WATER"
TestA.class from "blue" => "BLUE"
在应用程序中我有:
dependencies {
implementation project(':mylibrary')
}
flavorDimensions "water", "blue"
productFlavors {
water {
flavorDimensions "water"
applicationId "com.test.water"
matchingFallbacks = ['water']
}
blue {
flavorDimensions "blue"
applicationId "com.test.blue"
matchingFallbacks = ['blue']
}
}
但是当我选择" blueDebug"变种可以应用它吐司" MAIN"而不是" BLUE"正如我所期待的那样
为什么?
由于