cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

构建 鸿蒙-next 项目后, 生成的 deviceTypes 类型有问题

Open finscn opened this issue 6 months ago • 1 comments

Cocos Creator version

3.8.6

System information

鸿蒙 next

Issue description

目前构建后会生成一个 文件 : harmonyos-next/entry/src/main/module.json5 该文件中的 deviceTypes 值为 'default'

    "deviceTypes": [
      "default"
    ],

但是这个设置不支持 matepad 上运行. 运行时提示错误:

The deviceType or apiVersion of the target device does not match that configured in the module.json5 file.

如果要让项目在 matepad 真机上运行 ,需要加上 tablet :

    "deviceTypes": [
      "default",
      "tablet"
    ],

如果还要支持手机, 需要 再加上 phone :

    "deviceTypes": [
      "default",
      "phone",
      "tablet"
    ],

所以 构建鸿蒙的页面里 可能需要提供选择目标设备的checkbox.

Relevant error log output

No response

Steps to reproduce

目前每次构建后 我都要手动修改 module.json5

Minimal reproduction project

No response

finscn avatar May 28 '25 17:05 finscn

或者直接把 "phone", "tablet" 等 cocos支持的设备都写进去. 反正目前 用 default 我这里不能用 已经升级到最新的鸿蒙系统

finscn avatar May 29 '25 08:05 finscn