启动UIAbility时报错:must have required property 'startWindowIcon'怎么办?

问题现象

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

阅读 356
1 个回答

可能原因

UIAbility配置中缺少startWindowIcon属性配置
startWindowIcon:标识当前UIAbility组件启动页面图标资源文件的索引。

解决措施

在module.json5中abilities中配置startWindowIcon。

代码示例

{ 
  "module": { 
    // do something 
    "abilities": [{ 
      // do something 
      "startWindowIcon": "$media:space", 
      "startWindowBackground": "$color:white", 
    }] 
  } 
}

参考链接

Stage模型配置文件

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进