【错误记录】Gradle 配置 productFlavors 报错 ( All flavors must now belong to a named flavor dimension. )
文章目录
- 一、报错信息
- 二、解决方案
一、报错信息
在 build.gradle 中配置 productFlavors 后报错 ;
配置内容 :
// 定义不同的开发和产品风格productFlavors {// 开发风格dev {// 开发时使用 minSDKVersion = 21 允许 Android Gradle 插件// 为每个 Module 模块产生一个 APK 安装包 , 可以在 Android Lollipop 系统上进行测试// 无需进行耗时的 dex 合并过程minSdkVersion 21}// 产品风格prod {// 应用实际的最小 SDKminSdkVersion 14}}
报错内容 :
FAILURE: Build failed with an exception.* What went wrong:
A problem occurred configuring project ':app'.
> All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 198ms
二、解决方案
使用低版本的 Gradle 插件不会报错 , 使用高版本的 Gradle 插件报错 ;
在 build.gradle 中的 " android / defaultConfig " 层级下 , 配置 flavorDimensions 维度版本号 , 任意配置一个字符串作为值即可 ;
android {defaultConfig {// 维度版本号flavorDimensions "1.0"}
}
【错误记录】Gradle 配置 productFlavors 报错 ( All flavors must now belong to a named flavor dimension. )相关推荐
- 解决gradle编译报Error:All flavors must now belong to a named flavor dimension.问题
解决方案 为productFlavors 配置 flavorDimensions "version" android {...defaultConfig {...}buildTyp ...
- Android 报错处理:All flavors must now belong to a named flavor dimension,Learn more at https://d.android
查看链接 -> https://d.android.com/r/tools/flavorDimensions-missing-error-message.html 翻看文档,有一段话: Erro ...
- 安卓配置多渠道包error:All flavors must now belong to a named flavor dimension
安卓配置多渠道时突然报错,: FAILURE: Build failed with an exception. * What went wrong: A problem occurred config ...
- gradle ERROR: All flavors must now belong to a named flavor dimension.
在升级编译器为android studio 3.4.1后项目报错如下: ERROR: All flavors must now belong to a named flavor dimension. ...
- AndroidStudio Gradle 解决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 ...
- 【错误记录】VMware 虚拟机报错 ( 向 VMWare 虚拟机中的 Ubuntu 系统拷贝文件时磁盘空间不足 ② | 删除交换空间 )
文章目录 一.报错信息 二.解决方案 一.报错信息 在 [错误记录]VMware 虚拟机报错 ( 向 VMWare 虚拟机中的 Ubuntu 系统拷贝文件时磁盘空间不足 ) 博客中 , 给出了解决方案 ...
- 【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )
文章目录 一.报错信息 二.解决方案 一.报错信息 Google Play 上架要求 Android 的编译版本 和 目标版本都要高于 30 才可以上传 ; 将 Android 的编译版本 和 目标版 ...
- 【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 参考 [Flutter]Flutter Gallery 官方示例简介 博客 ; Flutter Galley 开源项目运行时 , 部署 ...
- 【错误记录】Flutter 构建报错 ( Because xxx requires SDK version >=2.12.0-0 <3.0.0, versio | Dart SDK 版本低 )
文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 event sent after app closed: {id: 0, progressId: null, message: Run ...
最新文章
- spring boot配置文件【application.yml】常见问题之一,未添加空格
- pthread 简要使用指南
- python绘图颜色深浅代表数值_画图理解Python的深浅拷贝
- 95-38-055-Buffer-UnpooledDirectByteBuf
- 《Python游戏趣味编程》 第4章 疯狂的小圆圈
- nec的reset文件摘要
- 2022电工杯A题利用启发式算法寻优
- 萤火虫算法 java_AGSO 萤火虫算法
- 达梦数据库错误号6002:消息校验异常
- Chrome 页面呈现原理与性能优化(内附分享 ppt)
- typora激活方法及使用教程
- 毛戈平上市以“光影美学”的理念打造适合中国人的高端化妆品品牌
- python重复import_Python 中循环 import 造成的问题如何解决?
- linux用什么命令查看ip,Linux中ip命令的使用实例
- 准确定位表单中的元素
- char远非仅仅是字符
- File 里面的flush()和close()
- 【机试】判断两个数互质
- 自我管理的经典书籍推荐:《自我管理必读12篇》
- 如何制作证件照?证件照怎么在线制作?