无法调试，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/2b/v3/bEK7MyX9TdmqP-ikkzLh0A/zh-cn_image_0000002624638412.png?HW-CC-KV=V1&HW-CC-Date=20260709T134351Z&HW-CC-Expire=86400&HW-CC-Sign=C490882AB0EF5520625381F34A0CE81E140E5406BAC351550B0E67901A2E7B4A "点击放大")

**问题分析**

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

![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/d2/v3/pYh9UprIR3G-NDEIIl_zzA/zh-cn_image_0000002654837821.png?HW-CC-KV=V1&HW-CC-Date=20260709T134351Z&HW-CC-Expire=86400&HW-CC-Sign=6B73E83BDEDB5F52B249636FF11C64F98E7482BFE2CE338DC2239E285485A4D6)

**解决措施**

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

![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/8c/v3/CiltH0uNQ2eh0U4BQBsJsQ/zh-cn_image_0000002624478512.png?HW-CC-KV=V1&HW-CC-Date=20260709T134351Z&HW-CC-Expire=86400&HW-CC-Sign=93B861802CCA66BC09FDC1F4060E18C41195227125476434E9DFB64D063AADFE "点击放大")