编译报错“please check deviceType or distroFilter/distributionFilter of the module”
==============================================================================

**问题现象**

HarmonyOS DevEco Studio编译时出现错误，提示如下之一：

*   Module: (xxx) and Module: (xxx) are entry, please check deviceType or distroFilter of the module.
    
    ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/53/v3/_VriNmKnRg-NKrolhMfgtw/zh-cn_image_0000002654797849.png?HW-CC-KV=V1&HW-CC-Date=20260709T134349Z&HW-CC-Expire=86400&HW-CC-Sign=07AAFA18AFDCA81EA243CE4F235A072A8190F79586333E466B186966F74F2F7B)
    
*   Module: (xxx) and Module: (xxx) have the same moduleName, please check deviceType or distroFilter of the module.
    
    ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/cf/v3/MV9M_WTrSeOx6KbO-DgX0g/zh-cn_image_0000002624638394.png?HW-CC-KV=V1&HW-CC-Date=20260709T134349Z&HW-CC-Expire=86400&HW-CC-Sign=E10A42ADCE47A4237526983CCF25A96049DEB7CC78B5A17C8D0C6BD90AD4E58D)
    
*   Module: (xxx) and Module: (xxx) have the same packageName, please check deviceType or distroFilter of the module.
    
    ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/61/v3/5IZhHaVoSOKc7VRyAR0P5w/zh-cn_image_0000002654837803.png?HW-CC-KV=V1&HW-CC-Date=20260709T134349Z&HW-CC-Expire=86400&HW-CC-Sign=2E79B6BFD4EBA54332EC4C8B50328E215BEA8B90F9E7040567470841506ED258)
    
*   Module: (xxx) and Module: (xxx) have the same ability name.
    
    ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/1d/v3/9r3vSlimTjiUF1VgilKg0w/zh-cn_image_0000002624478490.png?HW-CC-KV=V1&HW-CC-Date=20260709T134349Z&HW-CC-Expire=86400&HW-CC-Sign=D8D300A39BC7965DC05AB4CB0210D9604B1A4A5D3D1E3D9241D7BB89DB44F3AB)
    

**解决措施**

*   可能是打包时工程未满足HAP唯一性校验逻辑，请参考[HAP唯一性校验逻辑](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-hvigor-verification-rule)修改工程配置，满足校验逻辑即可正常打包。
*   如果工程中仅有一种设备类型，请确保工程级build-profile.json5文件中，同一模块的不同目标target的applyToProducts字段对应的product不相同。
    
    ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/4f/v3/Ik4qTHDvQy-j7NDzMOVnSQ/zh-cn_image_0000002654797851.png?HW-CC-KV=V1&HW-CC-Date=20260709T134349Z&HW-CC-Expire=86400&HW-CC-Sign=62E95CA5727BD4E52EA0DE593C74F3D88A4D6DBF26E1DCB54B74DBE74A5FB6B5)