无法调试，DevEco Studio提示“ The target can not be empty. Check the build-profile.json5 file of the project root directory and make sure the targets of the modules in configuration is set to specified product: default in applyToProducts.”
=======================================================================================================================================================================================================================================

**问题现象**

![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/e7/v3/oAzG8KpATHmKU0xO7PgDMw/zh-cn_image_0000002229604385.png?HW-CC-KV=V1&HW-CC-Date=20260612T074808Z&HW-CC-Expire=86400&HW-CC-Sign=65BFB2BF4F7F13678E5E8E9C6EE5A480B7A2ABE43C069F312A668D10B21363FE "点击放大")

**问题分析**

报该错误，可能是build-profile.json5文件中未添加“targets”配置，Module Target下为空，工程同步失败。

![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/cb/v3/tMB7jALtSCiJy-XHBIlybw/zh-cn_image_0000002272490329.png?HW-CC-KV=V1&HW-CC-Date=20260612T074808Z&HW-CC-Expire=86400&HW-CC-Sign=BC07DB5D83A9C928CBB5868B3AA09EC082B393C0267E94FF01A369677DBD016F)

**解决措施**

需要在模块级build-profile.json5文件中添加“targets”配置，点击“Sync Now”，待完成同步后，即可解决该问题（确保工程同步成功）。具体配置如图所示：

![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/c5/v3/gtOfGhr2Txmwr-1TXjTU6w/zh-cn_image_0000002229758873.png?HW-CC-KV=V1&HW-CC-Date=20260612T074808Z&HW-CC-Expire=86400&HW-CC-Sign=654238E6EE815F6D1875E10D9FAC6CB0DCE73AA7595BBC246C44D6B7396D6E57 "点击放大")