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

相关推荐
大雷神39 分钟前
HarmonyOS ArkGraphics 2D可变帧率实操——同屏对比30、60和90 FPS动画
华为·harmonyos
OH_TPC1 小时前
【鸿蒙优选三方库】@react-native-ohos/react-native-fast-image:高性能图片加载与缓存组件
缓存·华为·harmonyos·鸿蒙
贾伟康2 小时前
【句匠|03】HarmonyOS ArkTS 每日打卡实战:实现连续天数、补签边界和本地日期判断
harmonyos·arkts·本地存储·每日打卡·学习应用
小雨青年3 小时前
【HarmonyOS 7 平行视界深度实战】02 从普通页面到第一个平行视界 Demo
华为·harmonyos
~远在太平洋~3 小时前
06-鸿蒙系统 uitest UI 自动化指南
ui·自动化·harmonyos
OH_TPC3 小时前
OpenHarmony平台RN三方库适配情况
华为·harmonyos·鸿蒙
坚果的博客3 小时前
从 0 到 1:用 CJMP 开发「每日早报」鸿蒙应用完整实战
华为·harmonyos
Magic-ZYJ3 小时前
HarmonyOS 权限申请完整流程:声明、检查、请求、拒绝后二次授权
华为·harmonyos·移动应用开发·arcts·arcui
大雷神4 小时前
HarmonyOS ArkGraphics 2D场景化可变帧率实操——做一个智能帧率专注计时器
pytorch·华为·harmonyos
坚果的博客4 小时前
CPF-KMP-CMP:在鸿蒙上用 Kotlin 写跨平台应用
华为·kotlin·harmonyos