HarmonyOS 鸿蒙Next DevEco 运行本地模拟器报错“The type of the target device does not match the deviceType configured in the config.json file.”
HarmonyOS 鸿蒙Next DevEco 运行本地模拟器报错“The type of the target device does not match the deviceType configured in the config.json file.”
问题:
更新DevEco到3.0 beta2版本后,新建ets项目运行本地模拟器时报错2项如下:
“App Launch: The type of the target device does not match the deviceType configured in the config.json file。”
“Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]
compileSdkVersion and releaseType of the app do not match the apiVersion and releaseType on the device。”
原因分析:
-
查阅相关帖子DevEco Studio3.0 Beta2 无法启动本地模拟器-华为开发者论坛 (huawei.com) 评论中说可能是环境变量中的Android SDK与harmonyOS sdk冲突,但是本电脑没有配置Android SDK环境变量,排除此项
-
根据编译报错提示调试运行-常见问题-HarmonyOS应用开发中的“INSTALL_PARSE_FAILED_USESDK_ERROR处理指导”,核对项目build.gradle中的sdk版本信息,与本地手机模拟器api版本不相符,猜测由此导致的报错
改进建议:
- 官方尽快升级DevEco 3.0中本地模拟器的api版本
其他解决措施:
通过远程模拟Remote Emulator,选择API版本为7的设备运行
或者使用真机调试
更多关于HarmonyOS 鸿蒙Next DevEco 运行本地模拟器报错“The type of the target device does not match the deviceType configured in the config.json file.”的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
同样问题~按照这个解决了。
更多关于HarmonyOS 鸿蒙Next DevEco 运行本地模拟器报错“The type of the target device does not match the deviceType configured in the config.json file.”的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
这个本地模拟器的api版本,目前正在实现更新,请耐心等待新版本的发布哈!
开发者您好,感谢您的建议,相关问题已经反馈给工作人员,感谢您对华为开发者论坛的支持。
该错误信息“The type of the target device does not match the deviceType configured in the config.json file.”表明在DevEco Studio中运行本地模拟器时,目标设备的类型与config.json
文件中配置的设备类型不匹配。
要解决这个问题,请按照以下步骤操作:
-
检查
config.json
文件:- 打开项目的
config.json
文件。 - 查找
deviceType
字段,确认其值是否与你想运行的模拟器类型一致。例如,如果你想运行一个手机模拟器,deviceType
应该设置为相应的手机类型。
- 打开项目的
-
修改模拟器配置:
- 在DevEco Studio中,打开AVD Manager(Android Virtual Device Manager,虽然这里是HarmonyOS,但界面和操作类似)。
- 检查当前选中的模拟器配置,确保其类型与
config.json
中的deviceType
相匹配。
-
重启模拟器:
- 关闭当前运行的模拟器。
- 根据修改后的配置重新启动模拟器。
-
清理和重建项目:
- 在DevEco Studio中,尝试清理并重建项目,以确保所有配置被正确加载。
如果问题依旧没法解决请联系官网客服,官网地址是 https://www.itying.com/category-93-b0.html,