编译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
2024-12-12 12:06:28
浏览
收藏 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
微信
回复
2024-12-12 14:32:41
相关问题
HarmonyOS release安装
152浏览 • 1回复 待解决
HarmonyOS release无法安装
258浏览 • 1回复 待解决
HarmonyOS 如何打release
296浏览 • 1回复 待解决
HarmonyOS audioCapturer release失败会如何
263浏览 • 1回复 待解决
如何判断当前是release还是debug
1503浏览 • 1回复 待解决
HarmonyOS 发布release的指南
307浏览 • 1回复 待解决
HarmonyOS buildMode修改为release无法编译
222浏览 • 1回复 待解决
OpenHarmony3.1release 连接服务失败
6327浏览 • 1回复 待解决
HarmonyOS 如何打出RN-Release
444浏览 • 1回复 待解决
HarmonyOS 编译失败问题
316浏览 • 1回复 待解决
HarmonyOS 引入har编译失败
42浏览 • 1回复 待解决
HarmonyOS 使用hvigorw编译失败
220浏览 • 1回复 待解决
HarmonyOS RN empty project编译失败
319浏览 • 1回复 待解决
HarmonyOS windows系统下编译失败
461浏览 • 0回复 待解决
macOS 编译 Paddle-Lite 失败
1005浏览 • 1回复 待解决