HarmonyOS 鸿蒙Next多entry下应用启动报错“The type of the target device does not match the deviceType configured in the config.json”的解决

HarmonyOS 鸿蒙Next多entry下应用启动报错“The type of the target device does not match the deviceType configured in the config.json”的解决

问题

选择启动的模拟器是Phone。

启动应用时报错如下;

App Launch: The type of the target device does not match the deviceType configured in the config.json file.

原因

注意看上面的entry,是entrytv。

打开下拉列表,可以看到是有多个entry的。

可以这么理解,entry模块是用于Phone设备的,而entrytv是用于TV设备的。

解决

这里我们选择entry,再次启动Pnone模拟器,可以看到模拟器正常启动了。


更多关于HarmonyOS 鸿蒙Next多entry下应用启动报错“The type of the target device does not match the deviceType configured in the config.json”的解决的实战教程也可以访问 https://www.itying.com/category-93-b0.html

5 回复

手机模拟器运行也报错:The type of the target device does not match the deviceType configured in the config.json。

"module": {
  "deviceType": [
    "liteWearable", // 原有的
    "phone" // 新增,就可以了
  ],
  ...
}

更多关于HarmonyOS 鸿蒙Next多entry下应用启动报错“The type of the target device does not match the deviceType configured in the config.json”的解决的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


The type of the target device does not match the deviceType configured in the module.json5 file of the selected module.我用的真机他也报这种错误,设备类型

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

是这种也不行,也是华为的手机,一堆问题啊

项目名称

  • 状态:已完成
  • 类型:Web应用
  • 技术栈:React, Node.js, MongoDB

描述

这是一个用于管理个人日程的应用程序。用户可以添加、编辑和删除日程。

特点

  • 用户认证
  • 日程提醒
  • 数据可视化

没人指导一下吗,

  • 深色代码主题
  • 基本信息

该错误通常是由于config.json文件中deviceType配置与目标设备类型不匹配导致的。解决方法如下:

  1. 打开config.json文件,检查deviceType字段。
  2. 确保deviceType与目标设备类型一致,如phonetablet等。
  3. 如果项目包含多个entry,确保每个entryconfig.json文件都正确配置了deviceType
  4. 保存文件并重新编译运行。

如果问题仍未解决,建议检查设备连接状态和开发环境配置。

回到顶部