【HarmonyOS 6】 The target can not be empty. check the build.profile,json5 file of

一、问题背景

The target can not be empty. check the build-profile.json5 file of the project root directory andmake sure the targets afe modules in configuraton is set lo specifed product: default in applyToProducts

目标不能为空。 检查项目根目录的build-profile.json5文件,并确保配置中的目标afe模块设置为指定的产品:applyToProducts中的默认值

二、解决方案

在工程级build-profile.json5->modules[]->targets[]->applyToProducts中需要有default默认值

typescript 复制代码
"targets": [
  {
    "name": "default",
    "applyToProducts": [
      "default",
      "Community",
      "Ultimate"
    ]
  },
  {
    "name": "free",
    "applyToProducts": [
      "default",
      "Community"
    ]
  },
  {
    "name": "vip",
    "applyToProducts": [
      "default",
      "Ultimate"
    ]
  }
]

applyToProducts实际上用于配置多目标产物,详情参见:developer.huawei.com/consumer/cn...

相关推荐
li理几秒前
鸿蒙AVPlayer视频播放全解析:从基础实现到高级应用
harmonyos
HarmonyOS_SDK2 小时前
数字商品服务助力开发者降本增效,加速数字商品商业变现
harmonyos
后端小张4 小时前
【鸿蒙开发手册】重生之我要学习鸿蒙HarmonyOS开发
开发语言·学习·华为·架构·harmonyos·鸿蒙·鸿蒙系统
猫林老师5 小时前
HarmonyOS测试与上架:单元测试、UI测试与App Gallery Connect发布实战
ui·单元测试·harmonyos
SWUT胖虎5 小时前
ArkTS 中@Extend 和@Styles 装饰器的用法和区别
harmonyos·arkts·鸿蒙·鸿蒙系统
猫林老师6 小时前
鸿蒙元服务开发:免安装的卡片式服务(Atomic Service)
华为·wpf·harmonyos
shr007_17 小时前
flutter 鸿蒙
flutter·华为·harmonyos
鼓掌MVP20 小时前
【案例实战】多维度视角:鸿蒙2048游戏开发的深度分析与感悟
华为·ai编程·harmonyos·arkts·游戏开发·ability
安卓开发者20 小时前
鸿蒙Next Performance Analysis Kit:打造极致流畅的应用体验
华为·harmonyos
Devil枫21 小时前
【案例实战】HarmonyOS应用性能优化实战案例
华为·性能优化·harmonyos