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

相关推荐
ChinaDragon20 分钟前
HarmonyOS:不依赖UI组件的全局自定义弹出框 (openCustomDialog)
harmonyos
熊猫钓鱼>_>4 小时前
鸿蒙开发入门实战:从零构建你的第一个HarmonyOS应用(ArkTS版)
华为·harmonyos
安卓开发者4 小时前
鸿蒙NEXT安全单元访问开发指南:构建可信应用的安全基石
安全·华为·harmonyos
ChinaDragonDreamer10 小时前
HarmonyOS:固定样式弹出框
harmonyos·鸿蒙
Devil枫17 小时前
HarmonyOS 广告服务 ArkTS 实现指南:从激励广告到多形式适配
华为·harmonyos
猫林老师20 小时前
HarmonyOS 5 性能优化全攻略:从启动加速到内存管理
华为·性能优化·harmonyos
猫林老师1 天前
HarmonyOS 5 手势系统与高级交互动效开发实战
华为·交互·harmonyos
chensi_071 天前
uniapp x 鸿蒙开发之调试证书签名配置
服务器·uni-app·harmonyos
搬砖的小码农_Sky1 天前
鸿蒙(HarmonyOS)应用开发技能栈
harmonyos·鸿蒙系统
D.....l1 天前
Hi3861 OpenHarmony鸿蒙开发(嵌入式方向) (一)
华为·harmonyos