HarmonyOS 鸿蒙Next Ability启动失败
根据文档在做多Ability启动测试,发现在同一个module下的多个Ability是可以正确被UIAbilityContext.startAbility()启动,但当我尝试建立多个module后再entry所在module的page内去启动一个test module下的Ability会提示找不到Ability不知道是我看漏了什么文档还是有什么配置遗漏了? 项目的build-profile.json5如下,另一个使用的Login模板构建的model已经配置
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
{
"name": "xxx",
"srcPath": "./xxx",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
更多关于HarmonyOS 鸿蒙Next Ability启动失败的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
this.context.startAbility({
bundleName: "com.example.mycustomdialogcontrollerapplication",
abilityName: "NewModuleAbility"
},
方法中abilityName 对应module.json5中
abilities": [
{
"name": "NewModuleAbility",
}
的name,请检查 是否正确,
2.进入 Edit Configurations -> Deply Multi Hap,勾选Deploy Multi Hap Packages,安装module
更多关于HarmonyOS 鸿蒙Next Ability启动失败的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html