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

相关推荐
奋斗的小青年!!2 分钟前
Flutter跨平台开发:笔记分享功能适配OpenHarmony
flutter·harmonyos·鸿蒙
时光慢煮23 分钟前
从踩坑到跑通:uni-app 项目落地 HarmonyOS 的完整实录(含模拟器 / 真机)
华为·uni-app·harmonyos
小雨青年31 分钟前
我开发的鸿蒙原生应用【会议随记Pro】上架了
华为·harmonyos
威哥爱编程1 小时前
你的手势冲突解决了吗?鸿蒙事件拦截机制全解析
harmonyos·arkts·arkui
威哥爱编程1 小时前
鸿蒙异步并发 async/await 最佳实践,代码瞬间优雅
harmonyos·arkts·arkui
2501_948122632 小时前
React Native for OpenHarmony 实战:Steam 资讯 App 服务条款实现
javascript·react native·react.js·游戏·ecmascript·harmonyos
鸣弦artha2 小时前
Flutter 框架跨平台鸿蒙开发 —— Image Widget 占位符技术
flutter·华为·harmonyos
世人万千丶3 小时前
鸿蒙跨端框架Flutter学习day 2、常用UI组件-层叠布局 Stack & Positioned
学习·flutter·ui·实时互动·harmonyos·鸿蒙
酒醉的胡铁4 小时前
uniapp运行到鸿蒙证书配置
服务器·uni-app·harmonyos
hefengbao5 小时前
【京墨文库】安卓版 v.16.1, 鸿蒙版 v1.2.1发布
华为·harmonyos