鸿蒙library中如何引用本地har库

我在devstudio 的library中引用本地har库, build时报如下错误:

Error:The HAR generated by the library project is corrupted. The dependencies of the local HAR file are not supported during HAR building because the classes and HarmonyOS resources in the local HAR file dependencies are not packaged in the generated HAR

 

 

怎么向Android一样,   在library库的gradle调用repositories {
    flatDir {
        dirs 'libs'
    }
}

就可以正常的build和运行

harmony
2021-06-09 10:22:16
1.2w浏览
收藏 0
回答 3
回答 3
按赞同
/
按时间
张荣超_九丘教育
3

https://developer.harmonyos.com/cn/docs/documentation/doc-guides/creating_har-0000001059626724

分享
微博
QQ
微信
回复
2021-06-09 16:12:17
黑板报呀
3

本地库其实就是添加model,如果需要使用har包,需要通过maven仓库的形式引用。

官方文档

已于2021-6-10 08:44:25修改
分享
微博
QQ
微信
回复
2021-06-10 08:44:15
Tuer白晓明
1

可以放到libs目录下面^_^

分享
微博
QQ
微信
回复
2021-06-10 09:22:12


相关问题
HarmonyOS har包支持从maven引用
666浏览 • 1回复 待解决
HarmonyOS 本地资源如何引用
980浏览 • 1回复 待解决
HarmonyOS 三方本地module引用问题
1217浏览 • 1回复 待解决
如何引用本地目录的HSP
2323浏览 • 1回复 待解决
如何引用IDE工程外的har
1222浏览 • 1回复 待解决
HarmonyOS har引用so问题
1278浏览 • 1回复 待解决
求大佬告知如何引用HSP
2884浏览 • 1回复 待解决
HarmonyOS har包能否引用tgz包
886浏览 • 1回复 待解决
HarmonyOS har包是否不能互相引用
1542浏览 • 1回复 待解决
har引用报错的问题
1253浏览 • 1回复 待解决