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

相关推荐
爱写代码的森8 小时前
鸿蒙三方库 | harmony-utils之ImageUtil图片保存到本地详解
服务器·华为·harmonyos·鸿蒙·huawei
世人万千丶9 小时前
参数管理_Flutter在鸿蒙平台路由参数最佳实践
学习·flutter·华为·harmonyos·鸿蒙
90后的晨仔11 小时前
鸿蒙开发实战:图片完整显示、不失真、不留白 —— 深入理解 ImageFit 与动态宽高比适配
harmonyos
程序员黑豆13 小时前
鸿蒙应用开发实战:从零学会自定义组件
前端·华为·harmonyos
qizayaoshuap15 小时前
# [特殊字符] 名言警句 — 鸿蒙ArkTS数据管理与随机展示系统
华为·harmonyos
FrameNotWork15 小时前
HarmonyOS 6.0 LocalStorage页面级存储
华为·交互·harmonyos
FF2501_9402285816 小时前
Grid 构建月历网格:7 列模板 + 日期占位算法
后端·华为·harmonyos·鸿蒙系统
FrameNotWork16 小时前
HarmonyOS 6.0 自定义指令与手势组合:从单指到多指的交互进阶
华为·交互·harmonyos
胡琦博客16 小时前
HarmonyOS 智能工具箱(二):OCR 文字识别工具
华为·ocr·harmonyos
FrameNotWork16 小时前
HarmonyOS 6.0 数据可视化图表
华为·信息可视化·harmonyos