项目中创建了一个hsp,名字是base,现在在entry module中引用base的文件,出现如下错误
Error message:cannot find record ‘com.xxx.xxxx/base/ets/utils/UAUtil’, please check the request path.’/data/storage/el1/bundle/base/ets/modules.abc’.
已知引用路径正确,添加了base依赖
项目中创建了一个hsp,名字是base,现在在entry module中引用base的文件,出现如下错误
Error message:cannot find record ‘com.xxx.xxxx/base/ets/utils/UAUtil’, please check the request path.’/data/storage/el1/bundle/base/ets/modules.abc’.
已知引用路径正确,添加了base依赖
对外暴露的接口,需要在入口文件Index.ets中声明(base/Index.ets)
Index.ets:
export { add } from “./src/main/ets/utils/Calc”
export { UAUtil } from “./src/main/ets/utils/UAUtil”
entry里面的引入方式:import {UAUtil} from ‘base’
参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/in-app-hsp-V5