AS3.0多渠道打包解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.a
来源:互联网 发布:linux vim安装包下载 编辑:程序博客网 时间:2024/05/22 06:46
这个问题是Android studio升级到3.0之后,运行的时候会提示gradle要升级到3.5版本才能编译。于是我把我的gradle升级到了
gradle-4.1-milestone-1 版本,是2017年7月份最新版本了。
于是我把主程序的build.gradle中的gradle版本改成了这个,具体指定哪个版本我也不知道,于是就写了个3.0+
dependencies {
classpath ‘com.android.tools.build:gradle:3.0+’
}
然后再次编译,又发现了毒。
提示:Error:All flavors must now belong to a named flavor dimension.Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
这个一个错误,意思是:所有的flavors都必须属于同一个风格。
=。=懵逼
去翻墙看了它提供的地址才知道:
Plugin 3.0.0 includes a new dependency mechanism that automatically matches variants when consuming a library. This means an app’s debug variant automatically consumes a library’s debug variant, and so on. It also works when using flavors—an app’s redDebug variant will consume a library’s redDebug variant. To make this work, 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:
Error:All flavors must now belong to a named flavor dimension. The flavor 'flavor_name' is not assigned to a flavor dimension.
大致是说,Plugin 3.0.0之后有一种自动匹配消耗库的机制,便于debug variant 自动消耗一个库,然后就是必须要所有的flavor 都属于同一个维度。
为了避免flavor 不同产生误差的问题,应该在所有的库模块都使用同一个foo尺寸。
= 。=还是懵逼。说一堆依然不是很理解。
但是我们从中已经知道解决方案了:
在主app的build.gradle里面的
defaultConfig {
targetSdkVersion:*
minSdkVersion :*
versionCode:*
versionName :*
//版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,这样维度就是都是统一的了
flavorDimensions “versionCode”
}
就直接解决这个问题。然后app 就可以happy的运行起来了。
- 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: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
- 解决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/r
- Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r
- All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tool
- 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
- 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
- 《android日常bug系列》as升级3.0后报错,All flavors must now belong to a named flavor dimension.
- Error:Flavor 'prod' has no flavor dimension
- How to learn a book more effect?
- iOS - 解决Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named
- electron 仿制 ue4 蓝图 之 titlebar
- python用tcp实现局域网内文件传输(文本,图片,视频)
- call_user_func_array()使用场景
- bzoj 1711: [Usaco2007 Open]Dining吃饭(最大流)
- 10024---JPA--1初探
- AS3.0多渠道打包解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.a
- 5.5
- Lync server 2013 部署开发常用工具下载
- 4. Object有哪些公用方法?
- Git常用指令集合
- 如何将域名部署到Tomcat中,用域名访问服务器
- iOS 遇到后台返回字符串中带有\n
- Bootstrap学习笔记(一)引入环境/布局容器/栅格系统
- Noip2017普及组第二题