【发布时间】:2016-01-02 18:50:35
【问题描述】:
是否可以在 Gradle 中为两种产品风味创建两个 .properties 文件?
我正在构建一个具有两种风格的 Android 应用程序,我想为它们设置单独的属性,但这里有覆盖变量的问题:
productFlavors {
flavor1 {
customProperties = getCustomProperties("flavor1.properties");
}
flavor2 {
customProperties = getCustomProperties("flavor2.properties");
}
}
我的 customProperties 变量总是从 flavor2 属性中获取值,即使我构建了 flavor1。
我做错了什么? :)
更新:默认配置:
defaultConfig {
minSdkVersion 17
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
【问题讨论】:
标签: android gradle android-productflavors