we harmoyos 论坛

 找回密码
 立即注册
查看: 3013|回复: 2

编译 ipcamera_hispark_taurus 报错

[复制链接]
  • TA的每日心情
    开心
    2024-1-19 14:48
  • 签到天数: 17 天

    [LV.4]偶尔看看III

    48

    主题

    77

    帖子

    1007

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1007
    发表于 2022-6-18 12:46:45 | 显示全部楼层 |阅读模式


    1. [OHOS INFO] [6366/6547] LLVM LINK test/unittest/graphic/bin/graphic_test_ui_door.bin
    2. [OHOS INFO] [6367/6547] ACTION //third_party/wpa_supplicant/wpa_supplicant-2.9:wpa_supplicant-2.9(//build/lite/toolchain:linux_x86_64_ohos_clang)
    3. [OHOS INFO] [6368/6547] LLVM LINK obj/kernel/liteos_a/bin/liteos
    4. [OHOS ERROR] [6359/6547] ACTION //applications/sample/camera/cameraApp:cameraApp_hap(//build/lite/toolchain:linux_x86_64_ohos_clang)
    5. [OHOS ERROR] FAILED: obj/applications/sample/camera/cameraApp/cameraApp_hap_build_log.txt
    6. [OHOS ERROR] /usr/bin/python3 ../../../build/lite/hap_pack.py --packing-tool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/packing_tool/jar/app_packing_tool.jar --mode hap --json-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cameraApp/src/main/config.json --resources-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cameraApp/src/main/resources --ability-so-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/libcameraApp.so --force true --signtool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/hap-sign-tool.jar --privatekey OpenHarmony\ Application\ Release --sign-algo SHA256withECDSA --unsignhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/unsigned_cameraApp.hap --signhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/cameraApp.hap --sign-server rnd-signserver.huawei.com --jks-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmony.p12 --cert-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmonyApplication.pem --sign-by-server False --cert-profile /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cert/camera_HarmonyAppProvision_Release.p7b
    7. [OHOS ERROR] Traceback (most recent call last):
    8. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 166, in <module>
    9. [OHOS ERROR]     sys.exit(main())
    10. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 159, in main
    11. [OHOS ERROR]     hap_packing(args)
    12. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 85, in hap_packing
    13. [OHOS ERROR]     cmd_popen(packing_cmd)
    14. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 29, in cmd_popen
    15. [OHOS ERROR]     proc = subprocess.Popen(cmd)
    16. [OHOS ERROR]   File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    17. [OHOS ERROR]     self._execute_child(args, executable, preexec_fn, close_fds,
    18. [OHOS ERROR]   File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    19. [OHOS ERROR]     raise child_exception_type(errno_num, err_msg, err_filename)
    20. [OHOS ERROR] FileNotFoundError: [Errno 2] No such file or directory: 'java'
    21. [OHOS ERROR] [6360/6547] ACTION //applications/sample/camera/gallery:gallery_hap(//build/lite/toolchain:linux_x86_64_ohos_clang)
    22. [OHOS ERROR] FAILED: obj/applications/sample/camera/gallery/gallery_hap_build_log.txt
    23. [OHOS ERROR] /usr/bin/python3 ../../../build/lite/hap_pack.py --packing-tool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/packing_tool/jar/app_packing_tool.jar --mode hap --json-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/gallery/config.json --resources-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/gallery/resources --ability-so-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/libgallery.so --force true --signtool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/hap-sign-tool.jar --privatekey OpenHarmony\ Application\ Release --sign-algo SHA256withECDSA --unsignhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/unsigned_gallery.hap --signhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/gallery.hap --sign-server rnd-signserver.huawei.com --jks-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmony.p12 --cert-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmonyApplication.pem --sign-by-server False --cert-profile /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/gallery/cert/gallery_HarmonyAppProvision_Release.p7b
    24. [OHOS ERROR] Traceback (most recent call last):
    25. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 166, in <module>
    26. [OHOS ERROR]     sys.exit(main())
    27. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 159, in main
    28. [OHOS ERROR]     hap_packing(args)
    29. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 85, in hap_packing
    30. [OHOS ERROR]     cmd_popen(packing_cmd)
    31. [OHOS ERROR]   File "../../../build/lite/hap_pack.py", line 29, in cmd_popen
    32. [OHOS ERROR]     proc = subprocess.Popen(cmd)
    33. [OHOS ERROR]   File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    34. [OHOS ERROR]     self._execute_child(args, executable, preexec_fn, close_fds,
    35. [OHOS ERROR]   File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    36. [OHOS ERROR]     raise child_exception_type(errno_num, err_msg, err_filename)
    37. [OHOS ERROR] FileNotFoundError: [Errno 2] No such file or directory: 'java'
    38. [OHOS INFO] c targets overlap rate statistics
    39. [OHOS INFO] subsystem           files NO.       percentage      builds NO.      percentage      overlap rate
    40. [OHOS INFO] aafwk                     60        0.9%          60        0.9%    1.00
    41. [OHOS INFO] ace                      687        10.7%        687        10.7%   1.00
    42. [OHOS INFO] ai                        76        1.2%          76        1.2%    1.00
    43. [OHOS INFO] appexecfwk                38        0.6%          38        0.6%    1.00
    44. [OHOS INFO] communication            214        3.3%         214        3.3%    1.00
    45. [OHOS INFO] distributedschedule       43        0.7%          43        0.7%    1.00
    46. [OHOS INFO] global                    38        0.6%          38        0.6%    1.00
    47. [OHOS INFO] graphic                  325        5.1%         325        5.1%    1.00
    48. [OHOS INFO] hdf                      625        9.7%         625        9.7%    1.00
    49. [OHOS INFO] hiviewdfx                  9        0.1%           9        0.1%    1.00
    50. [OHOS INFO] kernel                  2408        37.4%       2408        37.4%   1.00
    51. [OHOS INFO] multimedia               120        1.9%         120        1.9%    1.00
    52. [OHOS INFO] powermgr                  25        0.4%          25        0.4%    1.00
    53. [OHOS INFO] securec                  117        1.8%         117        1.8%    1.00
    54. [OHOS INFO] security                 285        4.4%         285        4.4%    1.00
    55. [OHOS INFO] sensors                    7        0.1%           7        0.1%    1.00
    56. [OHOS INFO] startup                   68        1.1%          68        1.1%    1.00
    57. [OHOS INFO] third_party             1316        20.5%       1316        20.5%   1.00
    58. [OHOS INFO] updater                    4        0.1%           4        0.1%    1.00
    59. [OHOS INFO] utils                     12        0.2%          12        0.2%    1.00
    60. [OHOS INFO]
    61. [OHOS INFO] c overall build overlap rate: 1.00
    62. [OHOS INFO]
    63. [OHOS INFO]
    64. [OHOS ERROR] Please check build log in /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/build.log
    复制代码



    回复

    使用道具 举报

  • TA的每日心情
    开心
    2024-1-19 14:48
  • 签到天数: 17 天

    [LV.4]偶尔看看III

    48

    主题

    77

    帖子

    1007

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1007
     楼主| 发表于 2022-6-18 13:26:50 | 显示全部楼层
    关键是这句话 [OHOS ERROR] FileNotFoundError: [Errno 2] No such file or directory: 'java'  , 从日志看出是在 编译 ../../../build/lite/hap_pack.py 时出了问题, 看下这个文件中到底有啥

    1. root@turingkuang:/home/openharmony/code-v3.1.1-Release/OpenHarmony/build/lite# cat hap_pack.py
    2. #!/usr/bin/env python
    3. # -*- coding: utf-8 -*-

    4. #
    5. # Copyright (c) 2020 Huawei Device Co., Ltd.
    6. # Licensed under the Apache License, Version 2.0 (the "License");
    7. # you may not use this file except in compliance with the License.
    8. # You may obtain a copy of the License at
    9. #
    10. #     http://www.apache.org/licenses/LICENSE-2.0
    11. #
    12. # Unless required by applicable law or agreed to in writing, software
    13. # distributed under the License is distributed on an "AS IS" BASIS,
    14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15. # See the License for the specific language governing permissions and
    16. # limitations under the License.
    17. #

    18. import sys
    19. import os
    20. import argparse
    21. import subprocess
    22. from utils import makedirs
    23. import shutil
    24. import zipfile


    25. def cmd_popen(cmd):
    26.     proc = subprocess.Popen(cmd)
    27.     proc.wait()
    28.     ret_code = proc.returncode
    29.     if ret_code != 0:
    30.         print("hap warning: {} failed, return code is {}".format(
    31.             cmd, ret_code))


    32. def parse_args():
    33.     parser = argparse.ArgumentParser()
    34.     parser.add_argument('--packing-tool-path', help='packing tool path ')
    35.     parser.add_argument('--mode', help='package mode')
    36.     parser.add_argument('--json-path', help='profile')
    37.     parser.add_argument('--resources-path', help='resources')
    38.     parser.add_argument('--assets-path', help='assets')
    39.     parser.add_argument('--lib-path', help='lib')
    40.     parser.add_argument('--shared-libs-path', help='shared-libs')
    41.     parser.add_argument('--ability-so-path', help='ability so')
    42.     parser.add_argument('--index-path', help='index')
    43.     parser.add_argument('--unsignhap-path', help='unsignhap path')
    44.     parser.add_argument('--force', help='force')
    45.     parser.add_argument('--signtool-path', help='sign tool path')
    46.     parser.add_argument('--signhap-path', help='sign hap path')
    47.     parser.add_argument('--privatekey', help='privatekey')
    48.     parser.add_argument('--sign-server', help='sign_server')
    49.     parser.add_argument('--sign-algo', help='sign algo')
    50.     parser.add_argument('--cert-profile', help='cert profile')
    51.     parser.add_argument('--jks-path', help='jks path')
    52.     parser.add_argument('--cert-path', help='cert path')
    53.     parser.add_argument('--sign-by-server', help='sign mode')
    54.     args = parser.parse_args()

    55.     return args


    56. def hap_packing(args):
    57.     if not args.packing_tool_path:
    58.         print('hap warning: packing tool path empty')
    59.         return
    60.     packing_cmd = ['java', '-jar', args.packing_tool_path]
    61.     cmd_dict = {
    62.         '--mode': args.mode,
    63.         '--json-path': args.json_path,
    64.         '--resources-path': args.resources_path,
    65.         '--assets-path': args.assets_path,
    66.         '--lib-path': args.lib_path,
    67.         '--shared-libs-path': args.shared_libs_path,
    68.         '--ability-so-path': args.ability_so_path,
    69.         '--index-path': args.index_path,
    70.         '--out-path': args.unsignhap_path,
    71.         '--force': args.force,
    72.         '--sign-by-server': args.sign_by_server
    73.     }
    74.     for key, value in cmd_dict.items():
    75.         if value:
    76.             packing_cmd.extend([key, value])
    77.     cmd_popen(packing_cmd)


    78. def hap_signing(args):
    79.     user_name = ''
    80.     password = ''
    81.     if not args.signtool_path:
    82.         print('hap warning: signing tool path empty')
    83.         return

    84.     # sign by server
    85.     if args.sign_by_server == "True":
    86.         if 'ONLINE_USERNAME' in os.environ:
    87.             user_name = os.environ.get('ONLINE_USERNAME')
    88.         else:
    89.             print('hap warning: Environment variable ONLINE_USERNAME and ' +
    90.                   'ONLINE_PASSWD are needed for app signning. ' +
    91.                   'Please export it in bash.')
    92.             return
    93.         if 'ONLINE_PASSWD' in os.environ:
    94.             password = os.environ.get('ONLINE_PASSWD')
    95.         else:
    96.             print('hap warning: Environment variable ONLINE_USERNAME and ' +
    97.                   'ONLINE_PASSWD are needed for app signning. ' +
    98.                   'Please export it in bash.')
    99.             return
    100.         signing_cmd = [
    101.             'java', '-jar', args.signtool_path, 'sign', '-mode', 'remote',
    102.             '-profileSigned', '1'
    103.         ]
    104.         cmd_dict = {
    105.             '-privatekey': args.privatekey,
    106.             '-server': args.sign_server,
    107.             '-inputFile': args.unsignhap_path,
    108.             '-outputFile': args.signhap_path,
    109.             '-username': user_name,
    110.             '-password': password,
    111.             '-signAlg': args.sign_algo,
    112.             '-profile': args.cert_profile
    113.         }
    114.     # sign by software.
    115.     else:
    116.         signtool_path = args.signtool_path
    117.         #The default password of the key is 123456.
    118.         # You are advised to use a key and certificate management tool (
    119.         # such as keytool) to change the default password.
    120.         # For details, see section "Application Signature Verification
    121.         # Development Guide" in the Security Subsystem Development Guide.
    122.         signing_cmd = [
    123.             'java', '-jar', signtool_path, 'sign-app', '-mode', 'localsign',
    124.             '-profileSigned', '1', '-keystorePwd', '123456',
    125.             '-keyPwd', '123456','inForm','zip'
    126.         ]
    127.         cmd_dict = {
    128.             '-keyAlias': args.privatekey,
    129.             '-inFile': args.unsignhap_path,
    130.             '-outFile': args.signhap_path,
    131.             '-signAlg': args.sign_algo,
    132.             '-profileFile': args.cert_profile,
    133.             '-keystoreFile': args.jks_path,
    134.             '-appCertFile': args.cert_path
    135.         }
    136.     for key, value in cmd_dict.items():
    137.         if value:
    138.             signing_cmd.extend([key, value])
    139.     cmd_popen(signing_cmd)


    140. def main():
    141.     args = parse_args()

    142.     # Workaround: hap packing tools multi-thread contention issue.
    143.     makedirs(os.path.dirname(args.unsignhap_path), exist_ok=True)

    144.     hap_packing(args)
    145.     if os.path.exists(args.unsignhap_path):
    146.         hap_signing(args)
    147.         os.remove(args.unsignhap_path)


    148. if __name__ == '__main__':
    149.     sys.exit(main())
    复制代码


    发现了这句话,需要java 环境
    packing_cmd = ['java', '-jar', args.packing_tool_path]

    安装
    apt install openjdk-11-jre-headless
    再单独编译下这个模块发现可以了 .

    1. root@turingkuang:/home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus# /usr/bin/python3 ../../../build/lite/hap_pack.py --packing-tool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/packing_tool/jar/app_packing_tool.jar --mode hap --json-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cameraApp/src/main/config.json --resources-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cameraApp/src/main/resources --ability-so-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/libcameraApp.so --force true --signtool-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/hap-sign-tool.jar --privatekey OpenHarmony\ Application\ Release --sign-algo SHA256withECDSA --unsignhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/unsigned_cameraApp.hap --signhap-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/out/hispark_taurus/ipcamera_hispark_taurus/system/internal/cameraApp.hap --sign-server rnd-signserver.huawei.com --jks-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmony.p12 --cert-path /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmonyApplication.pem --sign-by-server False --cert-profile /home/openharmony/code-v3.1.1-Release/OpenHarmony/applications/sample/camera/cameraApp/cert/camera_HarmonyAppProvision_Release.p7b
    2. 06-18 01:05:38 INFO  - Start sign-app
    3. 06-18 01:05:39 INFO  - certificate in profile: camera Release
    4. 06-18 01:05:39 INFO  - /home/openharmony/code-v3.1.1-Release/OpenHarmony/developtools/hapsigner/dist/OpenHarmony.p12 is exist. Try to load it with given passwd
    5. 06-18 01:05:39 INFO  - Add sign data in sign info list success.
    6. 06-18 01:05:39 INFO  - Generate signing block success, begin write it to output file
    7. 06-18 01:05:39 INFO  - Sign Hap success!
    8. 06-18 01:05:39 INFO  - sign-app success
    复制代码

    ---------------------------------
    再执行下hb build 全部通过
    1. [OHOS INFO] [573/578] ACTION //build/ohos/packages:phone_parts_list(//build/lite/toolchain:linux_x86_64_ohos_clang)
    2. [OHOS INFO] [574/578] STAMP obj/build/ohos/packages/phone_parts_list.stamp
    3. [OHOS INFO] [575/578] ACTION //build/ohos/packages:gen_required_modules_phone(//build/lite/toolchain:linux_x86_64_ohos_clang)
    4. [OHOS INFO] [576/578] STAMP obj/build/ohos/packages/gen_required_modules_phone.stamp
    5. [OHOS INFO] [577/578] STAMP obj/build/ohos/packages/make_packages.stamp
    6. [OHOS INFO] [578/578] STAMP obj/build/core/gn/packages.stamp
    7. [OHOS INFO] 记录了53934+0 的读入
    8. [OHOS INFO] 记录了53934+0 的写出
    9. [OHOS INFO] 27614208字节(28 MB,26 MiB)已复制,0.0910722 s,303 MB/s
    10. [OHOS INFO] 记录了53918+0 的读入
    11. [OHOS INFO] 记录了53918+0 的写出
    12. [OHOS INFO] 27606016字节(28 MB,26 MiB)已复制,0.0907563 s,304 MB/s
    13. [OHOS INFO] 记录了102400+0 的读入
    14. [OHOS INFO] 记录了102400+0 的写出
    15. [OHOS INFO] 52428800字节(52 MB,50 MiB)已复制,0.167584 s,313 MB/s
    16. [OHOS INFO] c targets overlap rate statistics
    17. [OHOS INFO] subsystem           files NO.       percentage      builds NO.      percentage      overlap rate
    18. [OHOS INFO] aafwk                     60        0.9%          60        0.9%    1.00
    19. [OHOS INFO] ace                      687        10.7%        687        10.7%   1.00
    20. [OHOS INFO] ai                        76        1.2%          76        1.2%    1.00
    21. [OHOS INFO] appexecfwk                38        0.6%          38        0.6%    1.00
    22. [OHOS INFO] communication            214        3.3%         214        3.3%    1.00
    23. [OHOS INFO] distributedschedule       43        0.7%          43        0.7%    1.00
    24. [OHOS INFO] global                    38        0.6%          38        0.6%    1.00
    25. [OHOS INFO] graphic                  325        5.0%         325        5.0%    1.00
    26. [OHOS INFO] hdf                      625        9.7%         625        9.7%    1.00
    27. [OHOS INFO] hiviewdfx                  9        0.1%           9        0.1%    1.00
    28. [OHOS INFO] kernel                  2408        37.4%       2408        37.4%   1.00
    29. [OHOS INFO] multimedia               120        1.9%         120        1.9%    1.00
    30. [OHOS INFO] powermgr                  25        0.4%          25        0.4%    1.00
    31. [OHOS INFO] securec                  117        1.8%         117        1.8%    1.00
    32. [OHOS INFO] security                 285        4.4%         285        4.4%    1.00
    33. [OHOS INFO] sensors                    7        0.1%           7        0.1%    1.00
    34. [OHOS INFO] startup                   68        1.1%          68        1.1%    1.00
    35. [OHOS INFO] third_party             1316        20.4%       1316        20.4%   1.00
    36. [OHOS INFO] updater                    4        0.1%           4        0.1%    1.00
    37. [OHOS INFO] utils                     12        0.2%          12        0.2%    1.00
    38. [OHOS INFO]
    39. [OHOS INFO] c overall build overlap rate: 1.00
    40. [OHOS INFO]
    41. [OHOS INFO]
    42. [OHOS INFO] ipcamera_hispark_taurus build success
    43. [OHOS INFO] cost time: 0:01:49
    复制代码
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2024-1-19 14:48
  • 签到天数: 17 天

    [LV.4]偶尔看看III

    48

    主题

    77

    帖子

    1007

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1007
     楼主| 发表于 2022-6-18 13:37:39 | 显示全部楼层

    跟踪下编译脚本, 很清晰, 很好排查问题, 为鸿蒙点赞

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    手机版|小黑屋|we harmonyos 论坛 ( 粤ICP备 2022126345号 )

    GMT+8, 2024-4-29 03:13 , Processed in 0.053694 second(s), 25 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表