文章目录

  • 一、报错信息
  • 二、解决方案

一、报错信息


在 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. )相关推荐

  1. 解决gradle编译报Error:All flavors must now belong to a named flavor dimension.问题

    解决方案 为productFlavors 配置 flavorDimensions "version" android {...defaultConfig {...}buildTyp ...

  2. 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 ...

  3. 安卓配置多渠道包error:All flavors must now belong to a named flavor dimension

    安卓配置多渠道时突然报错,: FAILURE: Build failed with an exception. * What went wrong: A problem occurred config ...

  4. 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. ...

  5. 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 ...

  6. 【错误记录】VMware 虚拟机报错 ( 向 VMWare 虚拟机中的 Ubuntu 系统拷贝文件时磁盘空间不足 ② | 删除交换空间 )

    文章目录 一.报错信息 二.解决方案 一.报错信息 在 [错误记录]VMware 虚拟机报错 ( 向 VMWare 虚拟机中的 Ubuntu 系统拷贝文件时磁盘空间不足 ) 博客中 , 给出了解决方案 ...

  7. 【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )

    文章目录 一.报错信息 二.解决方案 一.报错信息 Google Play 上架要求 Android 的编译版本 和 目标版本都要高于 30 才可以上传 ; 将 Android 的编译版本 和 目标版 ...

  8. 【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )

    文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 参考 [Flutter]Flutter Gallery 官方示例简介 博客 ; Flutter Galley 开源项目运行时 , 部署 ...

  9. 【错误记录】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 ...

最新文章

  1. spring boot配置文件【application.yml】常见问题之一,未添加空格
  2. pthread 简要使用指南
  3. python绘图颜色深浅代表数值_画图理解Python的深浅拷贝
  4. 95-38-055-Buffer-UnpooledDirectByteBuf
  5. 《Python游戏趣味编程》 第4章 疯狂的小圆圈
  6. nec的reset文件摘要
  7. 2022电工杯A题利用启发式算法寻优
  8. 萤火虫算法 java_AGSO 萤火虫算法
  9. 达梦数据库错误号6002:消息校验异常
  10. Chrome 页面呈现原理与性能优化(内附分享 ppt)
  11. typora激活方法及使用教程
  12. 毛戈平上市以“光影美学”的理念打造适合中国人的高端化妆品品牌
  13. python重复import_Python 中循环 import 造成的问题如何解决?
  14. linux用什么命令查看ip,Linux中ip命令的使用实例
  15. 准确定位表单中的元素
  16. char远非仅仅是字符
  17. File 里面的flush()和close()
  18. 【机试】判断两个数互质
  19. 自我管理的经典书籍推荐:《自我管理必读12篇》
  20. 如何制作证件照?证件照怎么在线制作?

热门文章

  1. TCP/UDP常用端口列表
  2. 万字夜里爆肝,熬夜倾情奉献 Hive最最基础应用
  3. Win7防火墙允许ping
  4. 【python第一章 基础捋顺,第二章 python基础语法】
  5. C++实现黑白棋算法
  6. 基于auto.js微信点赞
  7. 冬季黄山(2~3 日游)攻略
  8. 关于Android高德地图路线规划的学习
  9. Vue引入CreateJS
  10. 获取各大电商平台、1688app上商品详情原数据API调用展示