我正在使用以下风格来改进 Android 5 及更高版本设备的调试版本:
productFlavors {
// Define separate dev and prod product flavors.
dev {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion 16
}
}
然而,并非我所有的设备都在 api 21+ 下运行,因此我想控制 multiDex 和缩小。例如:
productFlavors {
dev {
minSdkVersion 21
multiDexEnabled false
minifyEnabled false
}
prod {
minSdkVersion 16
multiDexEnabled true
minifyEnabled true
}
}
但这给了我:
Error:(44, 0) Could not find method minifyEnabled() for arguments [false] on ProductFlavor_Decorated
如何将这些属性组合在一起?