编译release包失败

hvigor Finished :entry:default@PackageHap… after 571 mshvigor Finished :entry:default@SignHap… after 2 s 68 ms
hvigor Finished :entry:assembleHap… after 1 mshvigor Finished ::MakeProjectPackInfo… after 3 ms
hvigor Finished ::GeneratePackRes… after 1 ms
hvigor ERROR: Failed ::PackageApp…
hvigor ERROR: Tools execution failed.
2024/06/17 16:55:38.923 - Ohos BundleTool [Error]: debug is different.
2024/06/17 16:55:38.923 - Ohos BundleTool [Error]: some app variable is different.
2024/06/17 16:55:38.923 - Ohos BundleTool [Error]: Compressor::compressAppMode compress failed.
2024/06/17 16:55:38.926 - Ohos BundleTool [Error]: Compressor::compressProcess Bundle exception.
2024/06/17 16:55:38.926 - Ohos BundleTool [Error]: Compressor::compressProcess compress failed.2024/06/17 16:55:38.926 - Ohos BundleTool [Error]: CompressEntrance::main exit, compress failedDetail: Please check the message from tools.hvigor ERROR: BUILD FAILED in 23 s 837 ms
HarmonyOS
12h前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
zbw_apple

出现这种问题是多模块引用时,各模块 app.json5的vendor字段不一致导致。打包时应用了哪些模块,排查方法如下:

1、File-> Setttings -> Build, Execution, Deployment -> Build Tools -> Hvigor 中将 Use log level 改成Debug。

2、重新执行 Build apps

3、Build 日志中搜索 “app_packing_tool”入参:–hap-path、–hsp-path,可得构建app时所有依赖的hsp和hap

4、hsp和hap的vendor要一致。

以我本地DevEco编译时,build日志检索结果如下:

hvigor DEBUG BasePackAppTask Use tool [PackageApp][‘java’,‘-Dfile.encoding=GBK’,‘-jar’,
‘D:\DevEco_pakage\Huawei\harmonyos\HarmonyOS-NEXT-DP1\base\toolchains\lib\app_packing_tool.jar’,‘–mode’,‘app’,‘–pack-info-path’,‘D:\demo\MyApplication\build\outputs\default\pack.info’,‘–hap-path’,
‘D:\demo\MyApplication\entry\build\default\outputs\default\app\entry-default.hap’,‘–hsp-path’,
‘D:\demo\MyApplication\library\build\default\outputs\default\app\library-default.hsp’,‘–force’,‘true’,‘–out-path’,
‘D:\demo\MyApplication\build\outputs\default\MyApplication-default-unsigned.app’,‘–main-module-limit’,‘2’,‘–normal-module-limit’,‘2’]

具体安装配置流程,请参考:https://developer.huawei.com/consumer/cn/doc/app/agc-help-harmonyos-internalrelease-0000001756878768

分享
微博
QQ
微信
回复
10h前
相关问题
HarmonyOS 如何打release
36浏览 • 1回复 待解决
HarmonyOS release无法安装
28浏览 • 1回复 待解决
如何判断当前是release还是debug
1291浏览 • 1回复 待解决
OpenHarmony3.1release 连接服务失败
6103浏览 • 1回复 待解决
HarmonyOS 发布release的指南
37浏览 • 1回复 待解决
HarmonyOS 如何打出RN-Release
196浏览 • 1回复 待解决
HarmonyOS RN empty project编译失败
153浏览 • 1回复 待解决
HarmonyOS windows系统下编译失败
338浏览 • 0回复 待解决
HarmonyOS ndk编译mars库失败
459浏览 • 1回复 待解决
macOS 编译 Paddle-Lite 失败
838浏览 • 1回复 待解决
缺失getcontext函数导致breakpad编译失败
890浏览 • 1回复 待解决
hi3861编译失败的原因
11348浏览 • 2回复 待解决
HarmonyOS RN功能依赖加载失败
9浏览 • 1回复 待解决