OpenHarmony开发者论坛

标题: OpenHarmony-5.0-Release编译报错 [打印本页]

作者: songqi    时间: 2024-9-19 16:46
标题: OpenHarmony-5.0-Release编译报错
[md]./build.sh --product-name rk3568 --ccache --no-prebuilt-sdk

ubuntu20.04


[OHOS INFO] [11645/27828] ACTION //applications/standard/dlp_manager:dlp_manager_compile_app(//build/toolchain/ohos:ohos_clang_arm)
[OHOS INFO] [0/0] ohpm_install_cmd:['ohpm', 'install']
[OHOS INFO] [0/0] ohpm DEBUG: start lock, pid: 3733701
[OHOS INFO] [0/0]
[OHOS INFO] [0/0] project dir: /home/songqi037/hongmeng5.0/applications/standard/dlp_manager
[OHOS INFO] [0/0] model_version: None
[OHOS INFO] [0/0] hvigor cmd: bash ./hvigorw assembleHap --mode module -p product=default -p module=entry -p debuggable=false -p buildMode=release --no-daemon
[OHOS INFO] [0/0] Hvigor clean start
[OHOS INFO] [0/0] Hvigor build start
[OHOS INFO] [1/1] Hvigor info: > hvigor CPU Architecture: x86_64
[OHOS INFO] [1/1] Hvigor info:
[OHOS INFO] [2/2] Hvigor warning: > hvigor ERROR: Unable to find the following components:
[OHOS INFO] [2/2] Hvigor warning:               toolchains:12
[OHOS INFO] [2/2] Hvigor warning:        Detail:
[OHOS INFO] [2/2] Hvigor warning:               1.Go to Tools > SDK Manager > SDK > OpenHarmony, download the components, and sync the project. Open SDK Manager
[OHOS INFO] [2/2] Hvigor warning:               2.Alternatively, modify the compileSdkVersion settings in the project-level build-profile.json5 file.
[OHOS INFO] [2/2] Hvigor warning: > hvigor ERROR: BUILD FAILED in 1 s 914 ms
[OHOS INFO] [11646/27828] ACTION //applications/standard/permission_manager:permission_manager_compile_app(//build/toolchain/ohos:ohos_clang_arm)
[OHOS INFO] [0/0] ohpm_install_cmd:['ohpm', 'install']
[OHOS INFO] [0/0] ohpm DEBUG: start lock, pid: 3733714
[OHOS INFO] [0/0]
[OHOS INFO] [0/0] project dir: /home/songqi037/hongmeng5.0/applications/standard/permission_manager
[OHOS INFO] [0/0] model_version: None
[OHOS INFO] [0/0] hvigor cmd: bash ./hvigorw assembleHap --mode module -p product=default -p module=permissionmanager -p debuggable=false -p buildMode=release --no-daemon
[OHOS INFO] [0/0] Hvigor clean start
[OHOS INFO] [0/0] Hvigor build start
[OHOS INFO] [1/1] Hvigor info: > hvigor CPU Architecture: x86_64
[OHOS INFO] [1/1] Hvigor info:
[OHOS INFO] [2/2] Hvigor warning: > hvigor ERROR: Unable to find the following components:
[OHOS INFO] [2/2] Hvigor warning:               toolchains:12
[OHOS INFO] [2/2] Hvigor warning:        Detail:
[OHOS INFO] [2/2] Hvigor warning:               1.Go to Tools > SDK Manager > SDK > OpenHarmony, download the components, and sync the project. Open SDK Manager
[OHOS INFO] [2/2] Hvigor warning:               2.Alternatively, modify the compileSdkVersion settings in the project-level build-profile.json5 file.
[OHOS INFO] [2/2] Hvigor warning: > hvigor ERROR: BUILD FAILED in 1 s 989 ms
[OHOS INFO] [11647/27828] SOLINK hdf/drivers_peripheral_clearplay/libmedia_key_system_factory_clearplay_service_1.0.z.so
[OHOS INFO] [11648/27828] SOLINK telephony/sms_mms/libtel_sms_mms_api.z.so
[OHOS INFO] [11649/27828] SOLINK hdf/drivers_peripheral_camera/libcamera_daemon.so
[OHOS INFO] [11650/27828] SOLINK hdf/drivers_peripheral_pin_auth/libpin_auth_interface_service_2.0.z.so
[OHOS INFO] [11651/27828] SOLINK hdf/drivers_peripheral_user_auth/libuser_auth_interface_service_2.0.z.so
[OHOS INFO] [11652/27828] ACTION //third_party/jsframework:gen_snapshot(//build/toolchain/ohos:ohos_clang_arm)
[OHOS INFO] end hpm command

[OHOS ERROR] [11645/27828] ACTION //applications/standard/dlp_manager:dlp_manager_compile_app(//build/toolchain/ohos:ohos_clang_arm)
[OHOS ERROR] FAILED: obj/applications/standard/dlp_manager/dlp_manager/unsigned_hap_path_list.json
[OHOS ERROR] /usr/bin/env ../../build/scripts/compile_app.py --nodejs ../../prebuilts/build-tools/common/nodejs/node-v16.20.2-linux-x64/bin/node --cwd ../../applications/standard/dlp_manager/ --build-profile ../../applications/standard/dlp_manager/build-profile.json5 --sdk-home /home/songqi037/hongmeng5.0/prebuilts/ohos-sdk/linux --output-file obj/applications/standard/dlp_manager/dlp_manager/unsigned_hap_path_list.json --ohpm-registry  --build-level module --assemble-type assembleHap --sdk-type-name sdk.dir --build-modules entry --hvigor-obfuscation
[OHOS ERROR] build_profile:../../applications/standard/dlp_manager/build-profile.json5; cwd:/home/songqi037/hongmeng5.0/applications/standard/dlp_manager
[OHOS ERROR] modules_list:[{'name': 'entry', 'srcPath': './entry', 'targets': [{'name': 'default', 'applyToProducts': ['default']}]}]

[OHOS ERROR] [11646/27828] ACTION //applications/standard/permission_manager:permission_manager_compile_app(//build/toolchain/ohos:ohos_clang_arm)
[OHOS ERROR] FAILED: obj/applications/standard/permission_manager/permission_manager/unsigned_hap_path_list.json
[OHOS ERROR] /usr/bin/env ../../build/scripts/compile_app.py --nodejs ../../prebuilts/build-tools/common/nodejs/node-v16.20.2-linux-x64/bin/node --cwd ../../applications/standard/permission_manager/ --build-profile ../../applications/standard/permission_manager/build-profile.json5 --sdk-home /home/songqi037/hongmeng5.0/prebuilts/ohos-sdk/linux --output-file obj/applications/standard/permission_manager/permission_manager/unsigned_hap_path_list.json --ohpm-registry  --build-level module --assemble-type assembleHap --sdk-type-name sdk.dir --build-modules permissionmanager --hvigor-obfuscation
[OHOS ERROR] build_profile:../../applications/standard/permission_manager/build-profile.json5; cwd:/home/songqi037/hongmeng5.0/applications/standard/permission_manager
[OHOS ERROR] modules_list:[{'name': 'entry', 'srcPath': './entry', 'targets': [{'name': 'default', 'applyToProducts': ['default']}]}, {'name': 'permissionmanager', 'srcPath': './permissionmanager', 'targets': [{'name': 'default', 'applyToProducts': ['default']}]}]

[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR]     return func(*args, **kwargs)
[OHOS ERROR]            ^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR]     super().run()
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/interface/build_module_interface.py", line 68, in run
[OHOS ERROR]     self._ninja()
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/util/timer_util.py", line 30, in inner
[OHOS ERROR]     res = func(*arg, **kwarg)
[OHOS ERROR]           ^^^^^^^^^^^^^^^^^^^
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/interface/build_module_interface.py", line 125, in _ninja
[OHOS ERROR]     self._target_compilation()
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/modules/ohos_build_module.py", line 102, in _target_compilation
[OHOS ERROR]     self.target_compiler.run()
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR]     self._execute_ninja_cmd()
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/services/ninja.py", line 69, in _execute_ninja_cmd
[OHOS ERROR]     SystemUtil.exec_command(
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/util/system_util.py", line 75, in exec_command
[OHOS ERROR]     LogUtil.get_failed_log(log_path)
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/util/log_util.py", line 193, in get_failed_log
[OHOS ERROR]     LogUtil.get_compiler_failed_log(log_path)
[OHOS ERROR]   File "/home/songqi037/hongmeng5.0/build/hb/util/log_util.py", line 180, in get_compiler_failed_log
[OHOS ERROR]     raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: COMPILE Failed! Please check error in /home/songqi037/hongmeng5.0/out/rk3568/error.log, and for more build information in /home/songqi037/hongmeng5.0/out/rk3568/build.log
[OHOS ERROR]

[OHOS ERROR] Code:        4000
[OHOS ERROR]
[OHOS ERROR] Reason:      COMPILE Failed! Please check error in /home/songqi037/hongmeng5.0/out/rk3568/error.log, and for more build information in /home/songqi037/hongmeng5.0/out/rk3568/build.log
[OHOS ERROR]
[OHOS ERROR] Error Type:  Ninja build error
[OHOS ERROR]
[OHOS ERROR] Description: An unknown error occurred while executing 'ninja -C'.
[OHOS ERROR]
[OHOS ERROR] Solution:    no solution
[OHOS ERROR]
=====build  error=====
[/md]
作者: 润开鸿_梁开祝    时间: 2024-9-24 09:11
去掉编译命令中的"--no-prebuilt-sdk"参数,再试试看。
作者: kuaile    时间: 2024-9-26 15:51
unsigned_hap_path_list.json报错一般为概率性报错,如果多次编译无法解决请回复我。
作者: nidoudoudoudou    时间: 2024-10-29 19:58
回复 kuaile: 多次编译 同样报错
作者: 深开鸿_胡瑞涛    时间: 2024-10-31 10:29
是编译这个应用/applications/standard/dlp_manager/时报错的;可能代码没拉全,重新拉取同步代码 repo sync,再编译试试呢
作者: nidoudoudoudou    时间: 2024-11-1 10:35
回复 深开鸿_胡瑞涛: 直接在这里下载的压缩文件然后解压的,应该没有问题吧。https://repo.huaweicloud.com/openharmony/os/5.0.0-Release/
作者: Jianwei Mao    时间: 2024-11-4 14:21
原来不止我一个人遇到这个问题!我还以为是公司http proxy有问题,看来真不是!

我也是编译dlp_manager的时候报错!

[OHOS ERROR] [69800/81830] ACTION //applications/standard/dlp_manager:dlp_manager_compile_app(//build/toolchain/ohos:ohos_clang_arm)

好奇怪啊,代码拉了好多次,从root用户换到普通用户也没用。
作者: nanfengchuiyeluo    时间: 2024-11-4 19:00
回复 kuaile: 我也出现这个问题,请问怎么解决?
作者: 深开鸿_胡瑞涛    时间: 2024-11-5 16:56
回复 nidoudoudoudou: 没问题的,要这个代码不行,可以试试用repo拉代码:https://gitee.com/openharmony/do ... 1%E8%8E%B7%E5%8F%96
作者: a_long    时间: 2024-11-22 09:48
回复 深开鸿_胡瑞涛: 你好,直接下载的全量压缩包编译也是报这个错,怎么解决呢?

作者: a_long    时间: 2024-11-22 09:55
回复 Jianwei Mao: 想问一下这个问题后来解决了吗
作者: hxsjs    时间: 2024-11-27 15:35
遇到了相同的问题,原因是ohos-sdk未正常编译
可以看看prebuilts/ohos-sdk是不是空的

作者: wyb_wyb    时间: 2024-12-6 09:13
回复 kuaile: 所以咋解决的呀
作者: wyb_wyb    时间: 2024-12-9 11:10
回复 Jianwei Mao: 有解决么,天呐

作者: 踏雪无痕    时间: 2024-12-9 19:37
用build.sh构建就可以了
./build.sh --product rk3568
作者: Jason Yan    时间: 2024-12-10 10:00
回复 踏雪无痕: 我是用的./build.sh --product-name rk3568 --ccache,没用的,一样报错
作者: 踏雪无痕    时间: 2024-12-10 10:51
回复 Jason Yan: 我这边是没有问题的,之前遇到了和你一样的问题,我用build.sh可以通过,用hb build -f/hb build就会报这个错误。
借用六楼的发言,原因就是ohos-sdk没有正常编译,但是使用命令单独编译ohos-sdk也会报错。使用./build.sh --product rk3568编译成功后,目录下面就会多了ohos-sdk。这个时候就没问题了

如果用./build.sh还是报错,建议重新repo一个新的库
作者: 踏雪无痕    时间: 2024-12-10 10:57
回复 Jason Yan: 另外,还可以试一下直接rm-rf ./out,把out目录全部删除之后,再用./build.sh构建,有可能之前编译的缓存直接拿来用了,所以报错
作者: 踏雪无痕    时间: 2024-12-10 12:06
回复 踏雪无痕: 如果还不行的话,就试一下我封装的docker环境,我测试过了,没有问题。记得使用./build.sh -p rk3568编译
作者: 踏雪无痕    时间: 2024-12-10 12:07
回复 踏雪无痕: docker教程链接:https://blog.csdn.net/qq_38844263/article/details/144087310
作者: Jason Yan    时间: 2024-12-11 08:46
回复 踏雪无痕: 用下面的命令可以编译过了,应该是一楼的那个参数生效了 ./build.sh --product-name rk3568 --ccache --no-prebuild-sdk --enable_notice_collection=false --gn-args build_product_type=DEBUG --gn-args load_test_config=false
作者: oh-assistant    时间: 2024-12-25 11:36
回复 润开鸿_梁开祝: 有的服务器可以,有的服务器不行,感觉还是个概率问题
作者: oh-assistant    时间: 2024-12-25 11:37
回复 kuaile: 不同服务器多次编译,依然不行
作者: Yricky    时间: 2025-1-18 02:25
回复 wyb_wyb: 把ohpm添加到环境变量里面
作者: 梦浪流云    时间: 2025-2-9 16:02
我也报4000错误,通过修改下内存16G+交换10G  CPU16核 存储200G+




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5