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
これらのプロパティを組み合わせるにはどうすればよいですか?