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

相关推荐
胡琦博客1 小时前
「21天开源鸿蒙PC先锋训练营」03详细解读鸿蒙PC命令行适配
华为·开源·harmonyos
waeng_luo1 小时前
[鸿蒙2025领航者闯关] Scroll滑动容器与布局优化技巧
harmonyos·鸿蒙·鸿蒙2025领航者闯关·鸿蒙6实战·开发者年度总结
waeng_luo2 小时前
[鸿蒙2025领航者闯关] 响应式布局与屏幕适配方案
华为·harmonyos·鸿蒙2025领航者闯关·鸿蒙6实战·开发者年度总结
kirk_wang5 小时前
Flutter Image Editor 适配鸿蒙HarmonyOS平台实践
flutter·华为·harmonyos
国霄7 小时前
(7)Kotlin/Js For Harmony——ArkTs 开发架构
harmonyos
盐焗西兰花7 小时前
鸿蒙学习实战之路:Dialog 组件封装最佳实践
学习·华为·harmonyos
大雷神7 小时前
HarmonyOS中高德地图第一篇:高德地图SDK集成与初始化
harmonyos
大雷神7 小时前
HarmonyOS中开发高德地图第五篇:定位蓝点功能
harmonyos
汉堡黄•᷄ࡇ•᷅8 小时前
鸿蒙开发:案例集合List:ListItem拖拽(交换位置,过渡动画)(性能篇)
华为·harmonyos·鸿蒙·鸿蒙系统
HONG````8 小时前
鸿蒙应用动态文件读取全指南:从JSON、XML到文本文件的解析实战
华为·harmonyos