HarmonyOS DevEco Studio Previewer 报错This module is referencing one or more HSPs and cannot be previewed. To preview components in an HSP, switch to the HSP first.?

如题:HarmonyOS DevEco Studio Previewer 报错This module is referencing one or more HSPs and cannot be previewed. To preview components in an HSP, switch to the HSP first.?

阅读 670
1 个回答

IDE配套的预览器新特性是预览不支持引用HSP。引用了HSP的模块不支持预览,请直接在HSP内预览,此点已在官方文档(https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-previewer-arkts-js-0000001693564010-V5)已有说明 。

若开发需要预览包内的资源页面开发阶段可采用har模块替代,开发完成后换回hsp,将HSP(动态共享包)转为HAR(静态共享包)参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs-V5/faq-project-management-V5\#section1037118144114

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