原因android studio 3.0新特性
解决办法
看不懂没关系
小白教程:
flavorDimensions "android" //productFlavors上面新添加一行
productFlavors {
google {
dimension "android" //新添加一行
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "谷歌市场"]
}
baidu {
dimension "android"//新添加一行
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "百度手机助手"]
}
}
官方教程:
// Specifies the flavor dimensions you want to use. The order in which you
// list each dimension determines its priority, from highest to lowest,
// when Gradle merges variant sources and configurations. You must assign
// each product flavor you configure to one of the flavor dimensions.
flavorDimensions "api", "mode"
productFlavors {
demo {
// Assigns this product flavor to the "mode" flavor dimension.
dimension "mode"
...
}
full {
dimension "mode"
...
}