Error:All flavors must now belong to a named flavor dimension. The flavor 'flavor_name' is ...
来源:互联网 发布:开票软件 000012 编辑:程序博客网 时间:2024/06/05 06:21
android studio 3.0,更新
classpath ‘com.android.tools.build:gradle:3.0.0’以后,出现报错
Error:All flavors must now belong to a named flavor dimension.The flavor 'flavor_name' is not assigned to a flavor dimension.
报错的原因:查看给出的链接地址:https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin
The plugin now requires that all flavors belong to a named flavor dimension—even if you intend to use only a single dimension. Otherwise, you will get the following build error:
意思大致说,这个3.0的插件要求flavor dimension必须要有,哪怕只有一个维度也要声明, flavorDimensions 是在android{}中的字段:可以理解成维度,比如下面只声明了一个渠道的维度,
flavorDimensions "channel" //渠道 productFlavors { qh360 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qh360"] dimension "channel" } baidu { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "baidu"] dimension "channel" } }
关于flavorDimensions 可以生成多维度,比如下面的代码
// 两个维度flavorDimensions "isFree", "channel"productFlavors { free { // 免费和付费用isFree做标识,小米和htc为发布到的平台用channel做标识,因而最后生成4 //种flavor,加上buildtype就是4*2=8种 dimension "isFree" ... } paid { dimension "isFree" ... } xiaomi{ dimension "channel" ... } htc{ dimension "channel" ... }}
其实就是在3.0插件以后,google要求必须添加这个flavorDimensions 这个字段哪怕是只有一个维度也要写上才不报错
阅读全文
0 0
- Error:All flavors must now belong to a named flavor dimension. The flavor 'flavor_name' is ...
- Error:All flavors must now belong to a named flavor dimension
- 解决 Error:All flavors must now belong to a named flavor dimension
- 解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
- 解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
- Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
- android studio3.0——Error:All flavors must now belong to a named flavor dimension. Learn more at ...
- Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r
- 解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
- Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r
- 解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
- 《android日常bug系列》as升级3.0后报错,All flavors must now belong to a named flavor dimension.
- All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tool
- AS3.0多渠道打包解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.a
- AS3.0多渠道打包解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.a
- Error:Flavor 'prod' has no flavor dimension
- HOWTO: Get the project flavor (subtype) of a Visual Studio project from an add-in
- OpenStack 类型模板(flavor)
- Qt qDebug() 的使用方法
- 科技创新才能引领未来
- 小白Python3爬虫
- LSP剩余时间(Remaining Lifetime)
- Java
- Error:All flavors must now belong to a named flavor dimension. The flavor 'flavor_name' is ...
- 80. Remove Duplicates from Sorted Array II
- Minimum Moves to Equal Array Elements II
- 怎样为爱犬挑选合适的狗粮
- linux清除文件内容最快的方法
- Unity 保存图片文理
- JSONcpp使用.
- 《赢》读书摘要01
- jQuery选择器