启动UIAbility时报错:must have required property 'startWindowIcon

通过startAbility()方法启动UIAbility时,编译报错:must have required property 'startWindowIcon'。

HarmonyOS
2024-01-20 09:39:33
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
无聊逛51

UIAbility配置中缺少startWindowIcon属性配置。

startWindowIcon:标识当前UIAbility组件启动页面图标资源文件的索引。

在module.json5中abilities中配置startWindowIcon。

代码示例

{ 
  "module": { 
    // do something 
    "abilities": [{ 
      // do something 
      "startWindowIcon": "$media:space", 
      "startWindowBackground": "$color:white", 
    }] 
  } 
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.

参考链接

Stage模型配置文件

分享
微博
QQ
微信
回复
2024-01-20 23:16:23


相关问题
拉起UIAbility时报错16000050
3313浏览 • 1回复 待解决
HarmonyOS 启动rn项目时报错
1006浏览 • 1回复 待解决
HarmonyOS UIAbility启动失败
1111浏览 • 1回复 待解决
HarmonyOS UIAbility 如何启动 RNAbility
943浏览 • 1回复 待解决
UIAbility组件的启动模式
1330浏览 • 1回复 待解决
HarmonyOS 运行HmosWorld时报错
1044浏览 • 1回复 待解决
HarmonyOS 应用发布时报错
710浏览 • 1回复 待解决