doubleyong
管理员
管理员
  • 最后登录2025-02-06
  • 发帖数1196
  • 最爱沙发
  • 喜欢达人
  • 原创写手
  • 社区居民
  • 忠实会员
阅读:521回复:0

鸿蒙模拟器显示空白:Will skip sign 'hos_hap'.

楼主#
更多 发布于:2024-11-13 10:58
问题:
跑模拟器时,显示空白,并且在Build中打印如下错误
WARN: Will skip sign 'hos_hap'. No signingConfigs profile is configured in current project.
      If needed, configure the signingConfigs in C:\harmony_next\code\JiaJiu\build-profile.json5.
原因:
模拟器在运行时,第一个页面显示的是EntryAbility.ets文件中设置的入口页面,所以,需要保证入口页面的正确,才能在模拟器中打开应用
EntryAbility.ets中设置的入口页面不存在,即会提示上面的错误。
入口设置代码如下红色部分:
onWindowStageCreate(windowStage: window.WindowStage): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');

  windowStage.loadContent('pages/Product2', (err) => { if (err.code) {
      hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return;
    }
    hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
  });
}

解决方案:
保存写的入口页面文件存在,且在resources/base/profile文件夹下的,main_pages.json文件中,页面的路径也存在。
知识需要管理,知识需要分享
游客


返回顶部

公众号

公众号