Error: No flavor is associated with flavor dimension 'xxx'
Error: No flavor is associated with flavor dimension 'xxx'
我的应用程序级 build.gradle 文件中有以下内容:
flavorDimensions "store", "features"
productFlavors {
amazon {
dimension "store"
...
}
play {
dimension "store"
...
}
none {
dimension "features"
...
}
myAwesomeFeature {
dimension "features"
...
}
anotherAwesomeFeature {
dimension "features"
...
}
all {
dimension "features"
...
}
}
当我尝试同步我的项目文件时出现错误 "Error: No flavor is associated with flavor dimension 'store'." 我之前在 productFlavors 中使用了 flavorDimension 但有编译器警告说它已被弃用 "dimension"...一个(或两个)它抛出错误。
我显然有 2 种口味的维度商店。我查看了文档和示例代码,但找不到问题所在。我尝试将我的 gradle 插件从 1.2.0 更新到 1.2.3,并且我尝试将我的 gradle 版本从 2.2.1 升级到 2.4。
我做错了什么?我尝试从 here and it gives a similar error. This article 复制示例,但毫无价值。
问题是由于某种原因,构建系统不喜欢 "none" 或 "all"(不确定是哪个,因为我都更改了它们)作为产品风格。我将它们更改为 noFeatures 和 allFeatures 并且效果很好。
如果有保留字就好了...如果它们在文档中很普遍那就太棒了。 AFAIK,all 和 none 不是 Java 或 Groovy 中的保留字。
如果错误消息更有意义,那就太棒了。
我的应用程序级 build.gradle 文件中有以下内容:
flavorDimensions "store", "features"
productFlavors {
amazon {
dimension "store"
...
}
play {
dimension "store"
...
}
none {
dimension "features"
...
}
myAwesomeFeature {
dimension "features"
...
}
anotherAwesomeFeature {
dimension "features"
...
}
all {
dimension "features"
...
}
}
当我尝试同步我的项目文件时出现错误 "Error: No flavor is associated with flavor dimension 'store'." 我之前在 productFlavors 中使用了 flavorDimension 但有编译器警告说它已被弃用 "dimension"...一个(或两个)它抛出错误。
我显然有 2 种口味的维度商店。我查看了文档和示例代码,但找不到问题所在。我尝试将我的 gradle 插件从 1.2.0 更新到 1.2.3,并且我尝试将我的 gradle 版本从 2.2.1 升级到 2.4。
我做错了什么?我尝试从 here and it gives a similar error. This article 复制示例,但毫无价值。
问题是由于某种原因,构建系统不喜欢 "none" 或 "all"(不确定是哪个,因为我都更改了它们)作为产品风格。我将它们更改为 noFeatures 和 allFeatures 并且效果很好。
如果有保留字就好了...如果它们在文档中很普遍那就太棒了。 AFAIK,all 和 none 不是 Java 或 Groovy 中的保留字。
如果错误消息更有意义,那就太棒了。