HarmonyOS 鸿蒙Next hsp子模块配置成集成态后项目运行编译报错

发布于 1周前 作者 wuwangju 来自 鸿蒙OS

HarmonyOS 鸿蒙Next hsp子模块配置成集成态后项目运行编译报错
期待HarmonyOS能在未来带来更多创新的技术和理念。

关于HarmonyOS 鸿蒙Next hsp子模块配置成集成态后项目运行编译报错的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

1 回复

有个一个 hsp 的模块,配置成集成态之后,运行时编译报错。

错误如下:

> hvigor ERROR: Failed :entry:default@CompileArkTS...
> hvigor ERROR: Cannot read properties of undefined (reading 'bundleName')

1 ERROR: ArkTS:ERROR Failed to resolve OhmUrl.
Error Message: Failed to get a resolved OhmUrl for "/Users/XXX/oh_modules/.ohpm/domhandler@5.0.3/oh_modules/domhandler/lib/esm/index.js" imported by "/Users/XXX/oh_modules/.ohpm/@ohos+htmlparser2@1.0.0/oh_modules/@ohos/htmlparser2/src/main/ets/esm/index.js".


* Try the following:
> Check whether the module which /Users/XXX/oh_modules/.ohpm/domhandler@5.0.3/oh_modules/domhandler/lib/esm/index.js belongs to is correctly configured.
> Check the corresponding file name is correct(including case-sensitivity).

COMPILE RESULT:FAIL {ERROR:2 WARN:24}

* Try the following:
> Check whether undefined attributes or methods are used in the hvigorconfig.ts and hvigorfile.ts files.
> Go to the official website for help
> More info: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-hvigor-faqs-0000001233028585-V5#section119742124315

> hvigor ERROR: BUILD FAILED in 41 s 919 ms


DevEco Studio版本:

DevEco Studio NEXT Developer Beta3
Build #DS-233.14475.28.36.503600
Build Version: 5.0.3.600, built on August 7, 2024


集成态 hsp 配置参考教程:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/in-app-hsp-V5#%E9%9B%86%E6%88%90%E6%80%81hsp

请问该如何解决?

回到顶部