HarmonyOS鸿蒙Next模拟器debug发布项目时,报error: failed to start ability.error: not supported in non-app-provision mode.
HarmonyOS鸿蒙Next模拟器debug发布项目时,报error: failed to start ability.error: not supported in non-app-provision mode. 各位大神帮看下,我在开源网站代码harmony-utils来学习。
在DevEco Studio工具使用SDK5.0.0(12)中以run方式在模拟器中正常发布时,可以正常发布、模拟器中app可以正常运行。
但是DevEco Studio工具中以debug模式在模拟器中发布时,可以正常完成build,但在debug发布时会报错,报错如下:
12/23 14:45:41:753: $ hdc shell aa start -a EntryAbility -b com.harmony.utils -D in 343 ms
12/23 14:45:41:755: Launch com.harmony.utils failed, starting handle failure progress
error: failed to start ability.error: not supported in non-app-provision mode.
Error while Launching ability
我网上搜索,结果中聊聊一两条说是buildModeSet的问题,我看项目中最顶层的build-profile.json5中配置的buildModeSet如下
"buildModeSet": [
{
"name": "debug",
},
{
"name": "release"
}
]
不知道是不是这里的问题。
希望有遇到过类似情况的大佬帮看一下,应该怎么处理。拜谢!
更多关于HarmonyOS鸿蒙Next模拟器debug发布项目时,报error: failed to start ability.error: not supported in non-app-provision mode.的实战教程也可以访问 https://www.itying.com/category-93-b0.html
你使用的签名证书是调试证书还是发布证书,或者自动签名?试一下删除签名后重签一下,以及模拟器清理一下重新运行呢?
在真机上试过有一样的问题吗,如果没有真机,可以申请使用远程真机,每天有300分钟免费[a href=“https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddebug-introduction-0000001057034023”]https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddebug-introduction-0000001057034023[/a]
更多关于HarmonyOS鸿蒙Next模拟器debug发布项目时,报error: failed to start ability.error: not supported in non-app-provision mode.的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS鸿蒙Next模拟器中,当debug发布项目时,报错“error: failed to start ability.error: not supported in non-app-provision mode.”通常是由于模拟器未启用应用调试模式(App Provisioning Mode)导致的。鸿蒙Next模拟器在默认情况下可能运行在非应用调试模式(Non-App-Provision Mode),该模式下不支持某些调试功能,尤其是Ability的启动。
要解决此问题,需要确保模拟器运行在应用调试模式下。具体操作如下:
- 打开DevEco Studio。
- 进入模拟器管理界面。
- 选择目标模拟器,确保其已启动。
- 在模拟器的设置中找到“Provision Mode”或“调试模式”。
- 将其切换为“App Provisioning Mode”或“应用调试模式”。
- 重新启动模拟器。
完成上述步骤后,再次尝试debug发布项目,通常可以解决该报错。
此错误表明你正在尝试在非应用配置模式下启动Ability,而该模式不支持此操作。要解决此问题,请确保在HarmonyOS鸿蒙Next模拟器中启用了应用配置模式。具体步骤如下:
- 打开
DevEco Studio。 - 进入
File>Project Structure>Modules。 - 在
Signing Configs中,确保已配置有效的签名信息。 - 重新构建并运行项目。
如果问题依然存在,请检查项目配置文件config.json,确保Ability的配置正确无误。

