国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

鴻蒙開(kāi)發(fā):OH編譯構(gòu)建分析 - 依賴(lài)關(guān)系檢查

這篇具有很好參考價(jià)值的文章主要介紹了鴻蒙開(kāi)發(fā):OH編譯構(gòu)建分析 - 依賴(lài)關(guān)系檢查。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

背景

OHOS的編譯構(gòu)建系統(tǒng)是由sh腳本(或bat腳本),python腳本,Gn和Ninja工具組成的編譯構(gòu)建框架??傮w編譯構(gòu)建流程是根據(jù)產(chǎn)品配置,生成具體依賴(lài)關(guān)系,然后使用Gn配置構(gòu)建目標(biāo),通過(guò)Gn生成ninja文件,然后執(zhí)行ninja生成二進(jìn)制,最后打包生成鏡像的過(guò)程。本篇主要涉及配置文件規(guī)則和編譯初期的規(guī)則檢查。

編譯初期(prebuild)

[OHOS INFO] Start building...

[OHOS INFO] Set cache size limit to 100.0 GB
[OHOS INFO] generated build prop info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build.prop
[OHOS INFO] generated build config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build_config.json
[OHOS INFO] generated product parts info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/parts.json
[OHOS INFO] generated parts config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/parts_config.json
[OHOS INFO] generated build gnargs prop info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build_gnargs.prop
[OHOS INFO] generated features info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/features.json
[OHOS INFO] generated syscap info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/syscap.json
[OHOS INFO] generated exclusion modules info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/exclusion_modules.json
[OHOS INFO] generated platforms build info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/platforms.build
[OHOS INFO] generated subsystem config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/subsystem_config.json
[OHOS INFO] generated system capability info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/systemcapability.json
[OHOS INFO] generated compile_standard_whitelist info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/compile_standard_whitelist.json
[OHOS INFO] generated compile_env_allowlist info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/compile_env_allowlist.json
[OHOS INFO] Checking all build args...
[OHOS INFO] subsytem config scan completed
warning: subsystem name config incorrect in '/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568/ohos.build', build file subsystem name is product_hihope,configured subsystem name is product_rk3568.
warning: subsystem name config incorrect in '/home/anybody/ohos/master/newsrc/device/board/hihope/rk3568/ohos.build', build file subsystem name is rockchip_products,configured subsystem name is device_rk3568.
[OHOS INFO] all parts scan completed
[OHOS INFO] Loading configuration file...

[OHOS INFO] loader args:['platforms_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/platforms.build"', 'subsystem_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/exclusion_modules.json"', 'source_root_dir="/home/anybody/ohos/master/newsrc/"', 'gn_root_out_dir="out/rk3568"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Checking parts config...
[OHOS INFO] generated subsystem build config to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/subsystem_build_config.json'
[OHOS INFO] generated src subsystem info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/src_subsystem_info.json'
[OHOS INFO] generated no src subsystem info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/no_src_subsystem_info.json'
[OHOS INFO] generate target platform parts to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/target_platforms_parts.json'
[OHOS INFO] generated system capabilities to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/phone_system_capabilities.json'
[OHOS INFO] generated platforms parts by src to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/platforms_parts_by_src.json'
[OHOS INFO] generate required parts targets to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/required_parts_targets.json'
[OHOS INFO] generate build targets list file to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/required_parts_targets_list.json'
[OHOS INFO] generated parts src flag to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/parts_src_flag.json'
[OHOS INFO] generate auto install part to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/auto_install_parts.json'
[OHOS INFO] generate platforms list to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/platforms_list.gni'
[OHOS INFO] generate part different info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/parts_different_info.json'
[OHOS INFO] generate infos for testfwk to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/infos_for_testfwk.json'
[OHOS INFO] Checking all product features...
[OHOS INFO] generate syscap info file to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/SystemCapability.json'
[OHOS INFO] generate syscap info with part name list to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/syscap.json'
[OHOS INFO] generate target syscap for init list to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/param/syscap.para'

[OHOS INFO] Excuting gn command: /home/anybody/ohos/master/newsrc/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name="rk3568" product_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" product_config_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" device_name="rk3568" device_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" device_company="rockchip" device_config_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" target_cpu="arm" is_standard_system=true ohos_build_compiler_specified="" ohos_build_time=1704150237815 ohos_build_datetime="2024-01-02 15:03:57" ace_engine_feature_enable_accessibility=true ace_engine_feature_enable_web=true datamgr_service_udmf=true code_signature_support_oh_code_sign=false enable_ohos_startup_init_feature_ab_partition=true enable_ohos_startup_init_feature_loader=true dsoftbus_feature_conn_p2p=true dsoftbus_feature_disc_ble=true dsoftbus_feature_conn_br=true dsoftbus_feature_conn_ble=true dsoftbus_feature_trans_udp_stream=true wifi_feature_non_seperate_p2p=true wifi_feature_non_hdf_driver=true graphic_2d_feature_rs_enable_eglimage=true graphic_2d_feature_use_texgine=true audio_framework_feature_dtmf_tone=true audio_framework_feature_opensl_es=true input_feature_combination_key=true input_feature_pointer_drawing=true input_feature_interceptor=true input_feature_monitor=true input_feature_keyboard=true input_feature_mouse=true input_feature_touchscreen=true input_feature_input_device=true memmgr_purgeable_memory=true fusion_interaction_coordination=false wpa_supplicant_driver_nl80211=true hdf_core_platform_test_support=true drivers_peripheral_input_feature_model=true drivers_peripheral_display_community=true drivers_peripheral_display_vdi_default=true drivers_peripheral_wlan_feature_enable_HDF_NL80211=true drivers_peripheral_wlan_feature_enable_HDF_UT=false drivers_peripheral_sensor_feature_model=true drivers_peripheral_audio_feature_full_test_suite=true drivers_peripheral_audio_feature_alsa_lib=false drivers_peripheral_audio_feature_effect=true drivers_peripheral_light_feature_model=true drivers_peripheral_vibrator_feature_model=true drivers_peripheral_codec_feature_support_omx_extend_test=true drivers_peripheral_codec_feature_support_hdi_v1=true use_ffrt=true ohos_build_enable_ccache=true ohos_build_type="debug" device_type="default" build_variant="root" root_perf_main="main" runtime_mode="release"" --args=product_name="rk3568" product_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" product_config_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" device_name="rk3568" device_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" device_company="rockchip" device_config_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" target_cpu="arm" is_standard_system=true ohos_build_compiler_specified="" ohos_build_time=1704150237815 ohos_build_datetime="2024-01-02 15:03:57" ace_engine_feature_enable_accessibility=true ace_engine_feature_enable_web=true datamgr_service_udmf=true code_signature_support_oh_code_sign=false enable_ohos_startup_init_feature_ab_partition=true enable_ohos_startup_init_feature_loader=true dsoftbus_feature_conn_p2p=true dsoftbus_feature_disc_ble=true dsoftbus_feature_conn_br=true dsoftbus_feature_conn_ble=true dsoftbus_feature_trans_udp_stream=true wifi_feature_non_seperate_p2p=true wifi_feature_non_hdf_driver=true graphic_2d_feature_rs_enable_eglimage=true graphic_2d_feature_use_texgine=true audio_framework_feature_dtmf_tone=true audio_framework_feature_opensl_es=true input_feature_combination_key=true input_feature_pointer_drawing=true input_feature_interceptor=true input_feature_monitor=true input_feature_keyboard=true input_feature_mouse=true input_feature_touchscreen=true input_feature_input_device=true memmgr_purgeable_memory=true fusion_interaction_coordination=false wpa_supplicant_driver_nl80211=true hdf_core_platform_test_support=true drivers_peripheral_input_feature_model=true drivers_peripheral_display_community=true drivers_peripheral_display_vdi_default=true drivers_peripheral_wlan_feature_enable_HDF_NL80211=true drivers_peripheral_wlan_feature_enable_HDF_UT=false drivers_peripheral_sensor_feature_model=true drivers_peripheral_audio_feature_full_test_suite=true drivers_peripheral_audio_feature_alsa_lib=false drivers_peripheral_audio_feature_effect=true drivers_peripheral_light_feature_model=true drivers_peripheral_vibrator_feature_model=true drivers_peripheral_codec_feature_support_omx_extend_test=true drivers_peripheral_codec_feature_support_hdi_v1=true use_ffrt=true ohos_build_enable_ccache=true ohos_build_type="debug" device_type="default" build_variant="root" root_perf_main="main" runtime_mode="release" /home/anybody/ohos/master/newsrc/out/rk3568

簡(jiǎn)單解讀(基本規(guī)則)

  • 編譯構(gòu)建的重要組成部分: OHOS的編譯構(gòu)建以下三個(gè)倉(cāng)是編譯構(gòu)建重要的三個(gè)倉(cāng):

  • productdefine:產(chǎn)品配置倉(cāng),包含了基礎(chǔ)部件的組成形態(tài),主要看/produdctdefine/common/base目錄下的文件

  • vendor:各廠家的產(chǎn)品倉(cāng),如大家最熟悉的/vendor/hihope/rk3568,編譯命令指定–product-name來(lái)尋找對(duì)應(yīng)的產(chǎn)品

  • build:編譯構(gòu)建倉(cāng),包括規(guī)范,檢查工具,編譯構(gòu)建腳本等等,OHOS編譯構(gòu)建的核心倉(cāng)

  • 關(guān)注重點(diǎn)

  • BUILD.gn:每個(gè)模塊都對(duì)應(yīng)一個(gè)BUILD.gn文件??梢允褂锰峁┑哪0澹部梢允褂胓n語(yǔ)法規(guī)則自定義編寫(xiě)。 例子: ? ohos_shared_library示例:

```html
    ```
    import("http://build/ohos.gni")
    ohos_shared_library("helloworld") {
      sources = []
      include_dirs = []
      cflags = []
      cflags_c = []
      cflags_cc = []
      ldflags = []
      configs = []
      deps =[]  # 部件內(nèi)模塊依賴(lài)
    
      # 跨部件模塊依賴(lài)定義,
      # 定義格式為 "部件名:模塊名稱(chēng)"
      # 這里依賴(lài)的模塊必須是依賴(lài)的部件聲明在inner_kits中的模塊
      external_deps = [
        "part_name:module_name",
      ]
    
      output_name = ""           # 可選,模塊輸出名
      output_extension = ""      # 可選,模塊名后綴
      module_install_dir = ""    # 可選,缺省在/system/lib64或/system/lib下, 模塊安裝路徑,模塊安裝路徑,從system/,vendor/后開(kāi)始指定
      relative_install_dir = ""  # 可選,模塊安裝相對(duì)路徑,相對(duì)于/system/lib64或/system/lib;如果有module_install_dir配置時(shí),該配置不生效
      install_images = []        # 可選,缺省值system,指定模塊安裝到那個(gè)分區(qū)鏡像中,可以指定多個(gè)
    
      part_name = "" # 必選,所屬部件名稱(chēng)
    }
    ```
    
    ```
    
    ? **_ohos_executable示例:_**
    
    ? ohos_executable模板屬性和ohos_shared_library基本一致
    
    ? _注意:可執(zhí)行模塊(即ohos_executable模板定義的)默認(rèn)是不安裝的,如果要安裝,需要指定install_enable = true_
    
    ? **_ohos_prebuilt_etc示例:_**
    

    
    ```html
    ```
    import("http://build/ohos.gni")
    ohos_prebuilt_etc("etc_file") {
      source = "file"
      deps = []                 # 部件內(nèi)模塊依賴(lài)
      module_install_dir = ""   #可選,模塊安裝路徑,從system/,vendor/后開(kāi)始指定
      relative_install_dir = "" #可選,模塊安裝相對(duì)路徑,相對(duì)于system/etc;如果有module_install_dir配置時(shí),該配置不生效
      install_images = []       # 可選,缺省值system,指定模塊安裝到那個(gè)分區(qū)鏡像中,可以指定多個(gè)
      part_name = ""            # 必選,所屬部件名稱(chēng)
    }
    ```
    
    ```
    
    ? 更多詳細(xì)的模板信息請(qǐng)參照[ 模塊配置規(guī)則](https://gitee.com/openharmony/docs/tree/master/zh-cn/device-dev/subsystems/subsys-build-module.md#%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE%E8%A7%84%E5%88%99)。
    
*   bundle.json:定義了子系統(tǒng)包含的部件。每個(gè)部件定義它所包含的模塊目標(biāo)component.build.sub_component,以及部件間交互的接口component.build.inner_kits,測(cè)試用例component.build.test_list。部件包含的模塊目標(biāo)component.build.sub_component是必須要說(shuō)明的。原來(lái)老版本有ohos.build,后面全部整改為bundle.json
    

    
    ```json
    {
      "name": "@ohos/<component_name>",                 # HPM部件英文名稱(chēng),格式"@組織/部件名稱(chēng)"
      "description": "xxxxxxxxxxxxxxxxxxx",             # 部件功能一句話(huà)描述
      "version": "3.1",                                 # 版本號(hào),版本號(hào)與OpenHarmony版本號(hào)一致
      "license": "MIT",                                 # 部件License
      "publishAs": "code-segment",                      # HPM包的發(fā)布方式,當(dāng)前默認(rèn)都為code_segment
      "segment": {
        "destPath": ""
      },                                                # 發(fā)布類(lèi)型為code_segment時(shí)為必填項(xiàng),定義發(fā)布類(lèi)型code_segment的代碼還原路徑(源碼路徑)
      "dirs": {},                                       # HPM包的目錄結(jié)構(gòu),字段必填內(nèi)容可以留空
      "scripts": {},                                    # HPM包定義需要執(zhí)行的腳本,字段必填,值非必填
      "licensePath": "COPYING",
      "readmePath": {
         "en": "README.rst"
      },
      "component": {                                   # 部件屬性
         "name": "<component_name>",                   # 部件名稱(chēng)
         "subsystem": "",                              # 部件所屬子系統(tǒng)
         "syscap": [],                                 # 部件為應(yīng)用提供的系統(tǒng)能力
         "features": [],                               # 部件對(duì)外的可配置特性列表,一般與build中的sub_component對(duì)應(yīng),可供產(chǎn)品配置
         "adapted_system_type": [],                    # 輕量(mini)小型(small)和標(biāo)準(zhǔn)(standard),可以是多個(gè)
         "rom": "xxxKB"                                # ROM基線,沒(méi)有基線寫(xiě)當(dāng)前值
         "ram": "xxxKB",                               # RAM基線,沒(méi)有基線寫(xiě)當(dāng)前值
         "deps": {
           "components": [],                         # 部件依賴(lài)的其他部件
           "third_party": []                         # 部件依賴(lài)的三方開(kāi)源軟件
         },
         "build": {                                    # 編譯相關(guān)配置
           "sub_component": ["部件包含模塊的gn目標(biāo)"],  # 部件編譯入口,新增模塊在此處配置
           "inner_kits": [],                         # 部件間接口
           "test": []                                # 部件測(cè)試用例編譯入口
         }
      }
    }
    
    ```
    
    新增部件的大致步驟就是在在部件目錄中新建一個(gè)bundle.json,然后再在//vendor/{product_company}/{product-name}/config.json中添加對(duì)應(yīng)的部件,直接添加到原有部件后即可。具體流程請(qǐng)參照編譯構(gòu)建指導(dǎo)的[ 配置規(guī)則](https://gitee.com/openharmony/docs/tree/master/zh-cn/device-dev/subsystems/subsys-build-all.md#%E9%85%8D%E7%BD%AE%E8%A7%84%E5%88%99)與[ 新增并編譯不同配置](https://gitee.com/openharmony/docs/tree/master/zh-cn/device-dev/subsystems/subsys-build-all.md#%E6%96%B0%E5%A2%9E%E5%B9%B6%E7%BC%96%E8%AF%91%E4%B8%8D%E5%90%8C%E9%85%8D%E7%BD%AE),其中詳細(xì)的介紹了如何添加一個(gè)模塊、部件或者子系統(tǒng)。
    
*   vendor里的config.json:指明了產(chǎn)品名,產(chǎn)品廠商,產(chǎn)品設(shè)備,版本,要編譯的系統(tǒng)類(lèi)型,以及產(chǎn)品包含的子系統(tǒng)。
    

    
    ```json
    {
      "product_name": "MyProduct",
      "version": "3.0",
      "type": "standard",
      "target_cpu": "arm",
      "ohos_version": "OpenHarmony 1.0",
      "device_company": "MyProductVendor",
      "board": "MySOC",
      "enable_ramdisk": true,
      "subsystems": [
      {
        "subsystem": "ace",
        "components": [
          { "component": "ace_engine_lite", "features":[""] }
        ]
      },
            ...
      ]
    }
    
    ```
    
    其他更詳細(xì)內(nèi)容請(qǐng)查看:[ build: Compilation and building framework and scripts | 編譯構(gòu)建框架和腳本 (gitee.com)](https://gitee.com/openharmony/build)

常見(jiàn)Q&A解讀(錯(cuò)誤處理)

常見(jiàn)七類(lèi)問(wèn)題:

  • subsystem_components

錯(cuò)誤原因:

子系統(tǒng)配置清單中的子系統(tǒng)名和部件配置清單中的子系統(tǒng)名不一致;或bundle.json中的部件名和部件配置清單中的部件名不一致

Warning: find subsystem startup_ext failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
或
Exception: find subsystem startup_ext failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
Warning: find component hiview_plugins_xxx failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
或
Exception: find component hiview_plugins failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.

解讀:

“subsystem” 代表產(chǎn)品部件列表(config.json)配置的子系統(tǒng)名錯(cuò)誤

“component”代表產(chǎn)品部件列表(config.json)配置的部件名錯(cuò)誤

此類(lèi)問(wèn)題代表vendor\xxx\build\component_config\system\XXX\part_config.json 文件中配置的子系統(tǒng)名或者部件名錯(cuò)誤,component 代表部件名配置錯(cuò)誤, subsystem 代表子系統(tǒng)名配置錯(cuò)誤

整改方法:

如果是子系統(tǒng)名配置錯(cuò)誤,請(qǐng)排查 part_config.json中配置的子系統(tǒng)名是否在subsystem_config.json中有配置

OHOS的subsystem_config.json路徑:build/subsystem_config.json

如果是部件名配置錯(cuò)誤,請(qǐng)排查part_config.json文件中的部件名是否和該部件的bundle.json中的部件名配置一致

  • bundle_subsystem_error

錯(cuò)誤原因:

bundle.json中定義的子系統(tǒng)名和子系統(tǒng)配置清單中的不一致

具體日志

登錄后復(fù)制

warning: subsystem name config incorrect in '/home/XXX/workspace/system_single_frame/system_component/foundation/ability/ability_base/bundle.json', build file subsystem name is ability, configured subsystem name is aafwk.
或
Exception: subsystem name config incorrect in '/home/XXX/workspace/system_single_frame/system_component/foundation/ability/ability_base/bundle.json', build file subsystem name is ability, configured subsystem name is aafwk.

解讀:

該問(wèn)題代表bundle.json里的子系統(tǒng)名稱(chēng)配置和subsystem_config.json配置不一致,需要整改bundle.json的子系統(tǒng)名稱(chēng)

bundle.json路徑:foundation/ability/ability_base/bundle.json

整改方法:

請(qǐng)檢查本部件bundle.json中是否有配置子系統(tǒng)并且配置的子系統(tǒng)名與subsystem_config.json中一致,若不一致,請(qǐng)將bundle.json中的子系統(tǒng)名改為subsystem_config.json中的子系統(tǒng)名

  • gn_part_or_subsystem_error

錯(cuò)誤原因:

BUILD.gn中定義的部件名或子系統(tǒng)名與bundle.json中定義的不一致

具體日志:

[OHOS INFO] warning: subsystem name or part name is incorrect, target is //foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0:libaudio_manager_daudio_primary_service_1.0, subsystem name is hdf, part name is drivers_peripheral_distributed_audio
或
Exception: subsystem name or part name is incorrect, target is //foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0:libaudio_manager_daudio_primary_service_1.0, subsystem name is hdf, part name is drivers_peripheral_distributed_audio

解讀:

該問(wèn)題代表模塊的BUILD.gn里面配置的子系統(tǒng)名或者部件名不準(zhǔn)確,需要和部件bundle.json對(duì)齊

BUILD.gn路徑:foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn

編譯目標(biāo):libaudio_manager_daudio_primary_service_1.0

整改方法:

將本部件下該模塊BUILD.gn中的部件名與子系統(tǒng)名改為本部件bundle.json中的子系統(tǒng)名和部件名

如果已確認(rèn)BUILD.gn和bundle.json中的子系統(tǒng)名和部件名一致,請(qǐng)?jiān)俅_認(rèn)part_config.json中是否正確配置了該子系統(tǒng)名和部件名

part_config.json路徑:(和編譯命令中abi-type、device-type參數(shù)一致)

系統(tǒng)組件:

vendor/xxx/build/component_config/system/XXX/part_config.json

vendor/xxx/build/component_config/system/XXX/part_config.json

芯片組件:

vendor/xxx/build/component_config/chipset/XXX/part_config.json

vendor/xxx/build/component_config/chipset/XXX/part_config.json

  • deps_added_external_part_module

錯(cuò)誤原因:

BUILD.gn中使用deps依賴(lài)了外部部件的模塊

具體日志:

[OHOS INFO] WARNING:deps validation part_name: 'distributed_camera', target: '//foundation/distributedhardware/distributed_camera/services/channel:distributed_camera_channel', dep: '//foundation/distributedhardware/distributed_hardware_fwk/interfaces/inner_kits:libdhfwk_sdk' failed!!

解讀:

該問(wèn)題代表該模塊通過(guò)deps依賴(lài)了部件外的模塊,應(yīng)該用external_deps依賴(lài)

BUILD.gn路徑:foundation/distributedhardware/distributed_camera/services/channel/BUILD.gn

編譯目標(biāo):distributed_camera_channel

deps中依賴(lài)的外部模塊:foundation/distributedhardware/distributed_hardware_fwk/interfaces/inner_kits:libdhfwk_sdk

整改方法:

將該模塊從deps轉(zhuǎn)移到external_deps中

注:deps中使用的是"路徑:模塊名",而改到external_deps中是使用 “部件名:模塊名” 的方式

  • external_deps_added_self_part_module

錯(cuò)誤原因:

使用external_deps依賴(lài)了本部件的模塊

具體日志:

[OHOS INFO] WARNING: preferences in target //foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences:preferences is dependency within part preferences, Need to used deps
或
Exception: preferences in target //foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences:preferences is dependency within part preferences, Need to used deps

解讀:

該日志代表該模塊通過(guò)external_deps依賴(lài)了本部件模塊,需要改成deps依賴(lài)

BUILD.gn路徑:foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences

external_deps中依賴(lài)的本部件:preferences

整改方法:

將該依賴(lài)從external_deps轉(zhuǎn)移到deps中

  • external_deps_bundle_not_add

**錯(cuò)誤原因:**BUILD.gn中外部依賴(lài)了其他部件的模塊,但是bundle.json中沒(méi)有添加這個(gè)部件

注:對(duì)于三方部件,如果BUILD.gn里面用的是deps依賴(lài),那在bundle.json中需要加到third_party中,如果使用的是external_deps依賴(lài)的三方部件,那在bundle.json中需要加到components中

具體日志:

[OHOS INFO] WARNING: //base/theme/wallpaper_mgr/frameworks/kits/extension:wallpaperextension depend part window_manager, need set part deps info to /home/XXX/workspace/system_single_frame/system_component/base/theme/wallpaper_mgr/bundle.json.
或
Exception: //base/theme/wallpaper_mgr/frameworks/kits/extension:wallpaperextension depend part window_manager, need set part deps info to /home/XXX/workspace/system_single_frame/system_component/base/theme/wallpaper_mgr/bundle.json.

解讀:

該日志代表該模塊(BUILD.gn)里面依賴(lài)的外部部件,但沒(méi)有在部件bundle.json聲明,需要在bundle.json聲明。

BUILD.gn路徑:base/theme/wallpaper_mgr/frameworks/kits/extension/BUILD.gn

編譯目標(biāo):wallpaperextension

依賴(lài)的部件:window_manager

bundle.json路徑:base/theme/wallpaper_mgr/bundle.json.

整改方法:

將被依賴(lài)的外部部件添加到bundle.json中的deps:components字段中,如上述例子中,需要將”input”和”window_manager”添加到bundle.json中

  • third_deps_bundle_not_add

錯(cuò)誤原因:

BUILD.gn中依賴(lài)了三方部件,但是部件bundle.json中沒(méi)有添加該三方部件

具體日志:

[OHOS INFO] WARNING: //base/security/device_auth/services:deviceauth_service depend part //third_party/cJSON:cjson, need set part deps cjson info to /home/XXX/workspace/chipset_single_frame/vendor_baltimore_musl/base/security/device_auth/bundle.json.
或
Exception: //base/security/device_auth/services:deviceauth_service depend part //third_party/cJSON:cjson, need set part deps cjson info to /home/XXX/workspace/chipset_single_frame/vendor_baltimore_musl/base/security/device_auth/bundle.json.

解讀:

該日志代表該模塊(BUILD.gn)里面依賴(lài)的三方部件,沒(méi)有在部件bundle.json中的third_party中聲明,需要在bundle.json聲明。

BUILD.gn路徑:base/security/device_auth/services

編譯目標(biāo):deviceauth_service

依賴(lài)的三方部件:cjson

bundle.json路徑:vendor_baltimore_musl/base/security/device_auth/bundle.json

整改方法:

將被依賴(lài)的三方部件添加到bundle.json中的deps:third_party字段中,如上述例子中,需要將 “cjson” 添加到bundle.json中文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-798912.html

到了這里,關(guān)于鴻蒙開(kāi)發(fā):OH編譯構(gòu)建分析 - 依賴(lài)關(guān)系檢查的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Harmony鴻蒙應(yīng)用開(kāi)發(fā)——關(guān)系型數(shù)據(jù)庫(kù)(RelationalStore)

    Harmony鴻蒙應(yīng)用開(kāi)發(fā)——關(guān)系型數(shù)據(jù)庫(kù)(RelationalStore)

    關(guān)系型數(shù)據(jù)庫(kù)基于 SQLite 組件,適用于存儲(chǔ)包含復(fù)雜關(guān)系數(shù)據(jù)的場(chǎng)景,比如一個(gè)班級(jí)的學(xué)生信息,需要包括姓名、學(xué)號(hào)、各科成績(jī)等,又或者公司的雇員信息,需要包括姓名、工號(hào)、職位等,由于數(shù)據(jù)之間有較強(qiáng)的對(duì)應(yīng)關(guān)系,復(fù)雜程度比鍵值型數(shù)據(jù)更高,此時(shí)需要使用關(guān)系型

    2024年01月16日
    瀏覽(74)
  • HarmonyOS鴻蒙開(kāi)發(fā)指南:構(gòu)建用戶(hù)界面 構(gòu)建布局

    目錄 布局說(shuō)明 添加標(biāo)題行和文本區(qū)域 添加圖片區(qū)域 添加留言區(qū)域 添加容器

    2024年02月22日
    瀏覽(24)
  • 鴻蒙(HarmonyOS)應(yīng)用開(kāi)發(fā)——構(gòu)建頁(yè)面(題目答案)

    1.在Column容器中的子組件默認(rèn)是按照從上到下的垂直方向布局的,其主軸的方向是垂直方向,在Row容器中的組件默認(rèn)是按照從左到右的水平方向布局的,其主軸的方向是水平方向。 正確(True) 2.List容器可以沿水平方向排列,也可以沿垂直方向排列。 正確(True) 3.當(dāng)Tabs組件的參數(shù)

    2024年01月20日
    瀏覽(35)
  • 【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴(lài)庫(kù)并進(jìn)行本地配置 Gradle 依賴(lài)的解決方案 | 構(gòu)建 Maven 依賴(lài)下載路徑 )

    【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴(lài)庫(kù)并進(jìn)行本地配置 Gradle 依賴(lài)的解決方案 | 構(gòu)建 Maven 依賴(lài)下載路徑 )

    編譯 Android Studio 項(xiàng)目時(shí) , 報(bào)如下錯(cuò)誤 , 下載依賴(lài)庫(kù)失敗 ; 報(bào)錯(cuò)信息 : 下面是 當(dāng)前 Android 項(xiàng)目的 Gradle 配置中的 Maven 倉(cāng)庫(kù) ; 其中使用 maven { url \\\"https://repo.spring.io/plugins-release/\\\" } 配置的 Maven 倉(cāng)庫(kù)就是對(duì)應(yīng)的地址 ; 使用 google() 函數(shù)配置的 Maven 倉(cāng)庫(kù)地址 是 https://maven.google.com/ , 可

    2024年04月15日
    瀏覽(106)
  • 鴻蒙系統(tǒng)開(kāi)發(fā)編譯指南(官網(wǎng)開(kāi)發(fā)文檔+docker環(huán)境方式)

    鴻蒙系統(tǒng)開(kāi)發(fā)編譯指南(官網(wǎng)開(kāi)發(fā)文檔+docker環(huán)境方式)

    注意1: OpenHarmony系統(tǒng)的開(kāi)發(fā)環(huán)境搭建、編譯、燒錄、調(diào)測(cè),最好直接參考官網(wǎng)開(kāi)發(fā)文檔,因?yàn)楦骂l繁,大多數(shù)人的流程都不一樣。 https://www.harmonyos.com/ ? ? ? ????????因?yàn)橐话愣夹枰褂妹钚胁僮鳎彝ㄟ^(guò)命令行操作才能深入了解原理,后續(xù)也可以在其基礎(chǔ)上增

    2024年02月05日
    瀏覽(23)
  • OpenHarmony鴻蒙源碼下載編譯和開(kāi)發(fā)環(huán)境搭建

    OpenHarmony鴻蒙源碼下載編譯和開(kāi)發(fā)環(huán)境搭建

    目錄 一、開(kāi)發(fā)環(huán)境搭建和源碼下載 二、編譯 三、總結(jié) ?一、開(kāi)發(fā)環(huán)境搭建 最好是在如Ubuntu18.04以上的系統(tǒng)中搭建,不然有些軟件依賴(lài)需要解決,加大搭建時(shí)間 如gitee中開(kāi)源OpenHarmony中的文檔所示,搭建開(kāi)發(fā)環(huán)境,搭建文檔網(wǎng)站如下: zh-cn/device-dev/get-code/sourcecode-acquire.md ·

    2024年01月21日
    瀏覽(49)
  • 鴻蒙系統(tǒng)開(kāi)發(fā)之編譯指南(官網(wǎng)開(kāi)發(fā)文檔+docker環(huán)境方式)

    鴻蒙系統(tǒng)開(kāi)發(fā)之編譯指南(官網(wǎng)開(kāi)發(fā)文檔+docker環(huán)境方式)

    注意1: OpenHarmony系統(tǒng)的開(kāi)發(fā)環(huán)境搭建、編譯、燒錄、調(diào)測(cè),最好直接參考官網(wǎng)開(kāi)發(fā)文檔,因?yàn)楦骂l繁,大多數(shù)人的流程都不一樣。 https://www.harmonyos.com/ ? ? ? ????????因?yàn)橐话愣夹枰褂妹钚胁僮?,而且通過(guò)命令行操作才能深入了解原理,后續(xù)也可以在其基礎(chǔ)上增

    2024年02月04日
    瀏覽(27)
  • 鴻蒙OpenHarmony【小型系統(tǒng) 編譯】(基于Hi3516開(kāi)發(fā)板)

    鴻蒙OpenHarmony【小型系統(tǒng) 編譯】(基于Hi3516開(kāi)發(fā)板)

    OpenHarmony支持hb和build.sh兩種編譯方式。此處介紹hb方式,build.sh腳本編譯方式請(qǐng)參考[使用build.sh腳本編譯源碼]。 進(jìn)入源碼根目錄,執(zhí)行如下命令進(jìn)行版本編譯。 說(shuō)明: ??_name_為產(chǎn)品名稱(chēng),例如Hi3516DV300、rk3568等。 檢查編譯結(jié)果。編譯完成后,log中顯示如下: 編譯所生成的文

    2024年04月28日
    瀏覽(22)
  • 鴻蒙(HarmonyOS)應(yīng)用開(kāi)發(fā)——構(gòu)建更加豐富的頁(yè)面(題目答案)

    1.@State修飾的屬性不允許在本地進(jìn)行初始化。 錯(cuò)誤(False) 解析: 2.@CustomDialog裝飾器用于裝飾自定義彈窗組件,使得彈窗可以自定義內(nèi)容及樣式。 正確(True) 3.將Video組件的controls屬性設(shè)置為false時(shí),不會(huì)顯示控制視頻播放的控制欄。 正確(True) 4.@Prop修飾的屬性值發(fā)生變化時(shí),此狀

    2024年02月03日
    瀏覽(21)
  • 鴻蒙開(kāi)發(fā)實(shí)例|構(gòu)建輕量級(jí)智能穿戴設(shè)備用戶(hù)界面

    鴻蒙開(kāi)發(fā)實(shí)例|構(gòu)建輕量級(jí)智能穿戴設(shè)備用戶(hù)界面

    HarmonyOS提供了輕量級(jí)智能穿戴應(yīng)用開(kāi)發(fā),開(kāi)發(fā)者可以在運(yùn)動(dòng)手表上開(kāi)發(fā)跨設(shè)備協(xié)同工作的應(yīng)用,如從與之匹配的智能手機(jī)、平板等各類(lèi)設(shè)備上獲取信息,便捷地顯示在運(yùn)動(dòng)手表上,或通過(guò)對(duì)運(yùn)動(dòng)手表的操作來(lái)控制其他設(shè)備上的操作任務(wù),為消費(fèi)者帶來(lái)更加靈活、智慧的分布式

    2024年02月03日
    瀏覽(93)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包