OpenHarmony开发者论坛

标题: 编译鸿蒙代码报Exception: find component taihe_ffi_gen failed怎么解决 [打印本页]

作者: wangkepeng    时间: 2026-8-6 17:55
标题: 编译鸿蒙代码报Exception: find component taihe_ffi_gen failed怎么解决
[md]### 【问题描述】

1. 介绍问题现象和发生的背景
   我在ubuntu20.4.6下载openharmony代码进行编译
2. 相关的代码(请勿使用截图)
3. 运行结果、错误截图
5. 我尝试过的解决方法和结果
6. 我想要达到的结果

wkp@flashservers:~/workspace/openharmony$ ./build.sh --product-name rk3568 --ccache

```
    *********Welcome to OpenHarmony!*********
```

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
System shell: bash 5.0.17(1)-release
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Current time: 2026-08-06 08:06:24
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Build args: --product-name rk3568 --ccache
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[OHOS INFO] Current Node.js version is v14.21.1
[OHOS INFO] Node.js version check passed!
[OHOS INFO] Ohpm initialization started...
[OHOS INFO] Current ohpm version is 5.0.8
ohpm WARN: Your "NodeJs" version is less than the recommended version "18.x.x", please upgrade it as soon as possible.
ohpm DEBUG: config set registry https://repo.harmonyos.com/ohpm/
ohpm DEBUG: start to write trace data
ohpm DEBUG: start to get key
ohpm DEBUG: start to get root key
ohpm DEBUG: start to get trace log dir
ohpm DEBUG: Audit failed, detail: the trace log file path is not exist! trace path: /home/wkp/Library/Caches/Huawei/DevEcoStudio5.0/TraceLogData
ohpm WARN: Your "NodeJs" version is less than the recommended version "18.x.x", please upgrade it as soon as possible.
ohpm DEBUG: config set strict_ssl false
ohpm DEBUG: start to write trace data
ohpm DEBUG: start to get key
ohpm DEBUG: start to get root key
ohpm DEBUG: start to get trace log dir
ohpm DEBUG: Audit failed, detail: the trace log file path is not exist! trace path: /home/wkp/Library/Caches/Huawei/DevEcoStudio5.0/TraceLogData
ohpm WARN: Your "NodeJs" version is less than the recommended version "18.x.x", please upgrade it as soon as possible.
ohpm DEBUG: config set log_level debug
ohpm DEBUG: start to write trace data
ohpm DEBUG: start to get key
ohpm DEBUG: start to get root key
ohpm DEBUG: start to get trace log dir
ohpm DEBUG: Audit failed, detail: the trace log file path is not exist! trace path: /home/wkp/Library/Caches/Huawei/DevEcoStudio5.0/TraceLogData
[OHOS INFO] installing pnpm...
[OHOS INFO] installing hypium...
[OHOS INFO] ohpm initialization successful!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[OHOS INFO] Start building...

[OHOS INFO]  Building the latest ohos-sdk...
[OHOS INFO]  Executing SDK build: /home/wkp/workspace/openharmony/prebuilts/python/linux-x86/3.12.10/bin/python3 /home/wkp/workspace/openharmony/build/hb/main.py build --product-name ohos-sdk --ccache=true --xcache=false --load-test-config=false --get-warning-list=false --stat-ccache=false --compute-overlap-rate=false --deps-guard=false --generate-ninja-trace=false --sbom=False --gn-args skip_generate_module_list_file=true sdk_platform=linux ndk_platform=linux use_cfi=false use_thin_lto=false enable_lto_O0=true sdk_check_flag=false enable_ndk_doxygen=false archive_ndk=false sdk_for_hap_build=true enable_archive_sdk=false enable_notice_collection=false enable_process_notice=false point_split=true
[OHOS INFO]  Set cache size limit to 100.0 GB
[OHOS INFO] [PRELOAD] generated build prop info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/build.prop
[OHOS INFO] [PRELOAD] generated build config info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/build_config.json
[OHOS INFO] [PRELOAD] generated product parts info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/parts.json
[OHOS INFO] [PRELOAD] generated parts config info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/parts_config.json
[OHOS INFO] [PRELOAD] generated build gnargs prop info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/build_gnargs.prop
[OHOS INFO] [PRELOAD] generated features info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/features.json
[OHOS INFO] [PRELOAD] generated syscap info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/syscap.json
[OHOS INFO] [PRELOAD] generated exclusion modules info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/exclusion_modules.json
[OHOS INFO] [PRELOAD] generated dependency pruning info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/dependency_pruning.json
[OHOS INFO] [PRELOAD] generated platforms build info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/platforms.build
[OHOS INFO] [PRELOAD] generated subsystem config info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/subsystem_config.json
[OHOS INFO] [PRELOAD] generated system capability info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/systemcapability.json
[OHOS INFO] [PRELOAD] generated compile_standard_whitelist info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/compile_standard_whitelist.json
[OHOS INFO] [PRELOAD] generated compile_env_allowlist info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/compile_env_allowlist.json
[OHOS INFO] [PRELOAD] generated hvigor_compile_whitelist info to /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/hvigor_compile_hap_whitelist.json
[OHOS INFO]  The run time for _prebuild_and_preload is 0.01 s
[OHOS INFO] [LOAD] Checking all build args...
[OHOS INFO] [LOAD] subsytem config scan completed costed is 3.77 s
[OHOS WARNING] [LOAD] condition target '//base/hiviewdfx/hilog/test:hilog_unittest' in '/home/wkp/workspace/openharmony/base/hiviewdfx/hilog/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//base/hiviewdfx/hilog/test:hilog_moduletest' in '/home/wkp/workspace/openharmony/base/hiviewdfx/hilog/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//base/hiviewdfx/hilog/test:fuzztest' in '/home/wkp/workspace/openharmony/base/hiviewdfx/hilog/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/napi:napi_packages_test' in '/home/wkp/workspace/openharmony/foundation/arkui/napi/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/napi/module_manager/test/unittest/module_manager_test:unittest' in '/home/wkp/workspace/openharmony/foundation/arkui/napi/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/napi/sample/native_module_systemtest:systemtest' in '/home/wkp/workspace/openharmony/foundation/arkui/napi/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/napi/test/unittest:unittest' in '/home/wkp/workspace/openharmony/foundation/arkui/napi/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/napi/test/fuzztest:fuzztest' in '/home/wkp/workspace/openharmony/foundation/arkui/napi/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/ace_engine/test/unittest:unittest' in '/home/wkp/workspace/openharmony/foundation/arkui/ace_engine/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//foundation/arkui/ace_engine/test/benchmark:benchmark' in '/home/wkp/workspace/openharmony/foundation/arkui/ace_engine/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//arkcompiler/ets_runtime/compiler_service:static_app_install_aot_enable_list.conf' in '/home/wkp/workspace/openharmony/arkcompiler/ets_runtime/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//arkcompiler/ets_runtime:ark_js_unittest' in '/home/wkp/workspace/openharmony/arkcompiler/ets_runtime/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//arkcompiler/ets_runtime/compiler_service/test:compiler_service_unittest' in '/home/wkp/workspace/openharmony/arkcompiler/ets_runtime/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'
[OHOS WARNING] [LOAD] condition target '//arkcompiler/ets_runtime/compiler_service/test:compiler_service_fuzztest' in '/home/wkp/workspace/openharmony/arkcompiler/ets_runtime/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'

[OHOS ERROR] [LOAD] Traceback (most recent call last):
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] [LOAD]     return func(*args, **kwargs)
[OHOS ERROR] [LOAD]            ^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/ohos_build_module.py", line 68, in run
[OHOS ERROR] [LOAD]     super().run()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/interface/build_module_interface.py", line 66, in run
[OHOS ERROR] [LOAD]     self._load()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/ohos_build_module.py", line 100, in _load
[OHOS ERROR] [LOAD]     self.loader.run()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/services/interface/load_interface.py", line 50, in run
[OHOS ERROR] [LOAD]     self.__post_init__()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/services/loader.py", line 131, in __post_init__
[OHOS ERROR] [LOAD]     self.parts_config_info = load_ohos_build.get_parts_info(
[OHOS ERROR] [LOAD]                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 963, in get_parts_info
[OHOS ERROR] [LOAD]     _output_parts_info(parts_config_dict,
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 779, in _output_parts_info
[OHOS ERROR] [LOAD]     check_subsystem_and_component(parts_info_output_path, skip_partlist_check)
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 702, in check_subsystem_and_component
[OHOS ERROR] [LOAD]     compare_subsystem_and_component(subsystem_name, components_name, subsystem_components_whitelist_info,
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 668, in compare_subsystem_and_component
[OHOS ERROR] [LOAD]     raise Exception(message)
[OHOS ERROR] [LOAD] Exception: find component taihe_ffi_gen failed, please check it in /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/parts.json.
[OHOS ERROR] [LOAD]

[OHOS ERROR] [LOAD] Code:        0000
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Reason:      find component taihe_ffi_gen failed, please check it in /home/wkp/workspace/openharmony/out/preloader/ohos-sdk/parts.json.
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Error Type:  UNKNOWN ERROR TYPE
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Description: NO DESCRIPTION
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Solution:    NO SOLUTION
[OHOS ERROR] [LOAD]

[OHOS ERROR]  SDK build command failed: Command '['/home/wkp/workspace/openharmony/prebuilts/python/linux-x86/3.12.10/bin/python3', '/home/wkp/workspace/openharmony/build/hb/main.py', 'build', '--product-name', 'ohos-sdk', '--ccache=true', '--xcache=false', '--load-test-config=false', '--get-warning-list=false', '--stat-ccache=false', '--compute-overlap-rate=false', '--deps-guard=false', '--generate-ninja-trace=false', '--sbom=False', '--gn-args', 'skip_generate_module_list_file=true sdk_platform=linux ndk_platform=linux use_cfi=false use_thin_lto=false enable_lto_O0=true sdk_check_flag=false enable_ndk_doxygen=false archive_ndk=false sdk_for_hap_build=true enable_archive_sdk=false enable_notice_collection=false enable_process_notice=false point_split=true']' returned non-zero exit status 255.
[OHOS INFO]  Set cache size limit to 100.0 GB
[OHOS INFO] [PRELOAD] generated build prop info to /home/wkp/workspace/openharmony/out/preloader/rk3568/build.prop
[OHOS INFO] [PRELOAD] generated build config info to /home/wkp/workspace/openharmony/out/preloader/rk3568/build_config.json
[OHOS INFO] [PRELOAD] generated product parts info to /home/wkp/workspace/openharmony/out/preloader/rk3568/parts.json
[OHOS INFO] [PRELOAD] generated parts config info to /home/wkp/workspace/openharmony/out/preloader/rk3568/parts_config.json
[OHOS INFO] [PRELOAD] generated build gnargs prop info to /home/wkp/workspace/openharmony/out/preloader/rk3568/build_gnargs.prop
[OHOS INFO] [PRELOAD] generated features info to /home/wkp/workspace/openharmony/out/preloader/rk3568/features.json
[OHOS INFO] [PRELOAD] generated syscap info to /home/wkp/workspace/openharmony/out/preloader/rk3568/syscap.json
[OHOS INFO] [PRELOAD] generated exclusion modules info to /home/wkp/workspace/openharmony/out/preloader/rk3568/exclusion_modules.json
[OHOS INFO] [PRELOAD] generated dependency pruning info to /home/wkp/workspace/openharmony/out/preloader/rk3568/dependency_pruning.json
[OHOS INFO] [PRELOAD] generated platforms build info to /home/wkp/workspace/openharmony/out/preloader/rk3568/platforms.build
[OHOS INFO] [PRELOAD] generated subsystem config info to /home/wkp/workspace/openharmony/out/preloader/rk3568/subsystem_config.json
[OHOS INFO] [PRELOAD] generated system capability info to /home/wkp/workspace/openharmony/out/preloader/rk3568/systemcapability.json
[OHOS INFO] [PRELOAD] generated compile_standard_whitelist info to /home/wkp/workspace/openharmony/out/preloader/rk3568/compile_standard_whitelist.json
[OHOS INFO] [PRELOAD] generated compile_env_allowlist info to /home/wkp/workspace/openharmony/out/preloader/rk3568/compile_env_allowlist.json
[OHOS INFO] [PRELOAD] generated hvigor_compile_whitelist info to /home/wkp/workspace/openharmony/out/preloader/rk3568/hvigor_compile_hap_whitelist.json
[OHOS INFO]  The run time for _prebuild_and_preload is 0.02 s
[OHOS INFO] [LOAD] Checking all build args...
[OHOS INFO] [LOAD] subsytem config scan completed costed is 4.02 s
warning: subsystem name config incorrect in '/home/wkp/workspace/openharmony/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/wkp/workspace/openharmony/device/board/hihope/rk3568/ohos.build', build file subsystem name is rockchip_products,configured subsystem name is device_rk3568.
[OHOS WARNING] [LOAD] condition target '//arkcompiler/ets_runtime/compiler_service:static_app_install_aot_enable_list.conf' in '/home/wkp/workspace/openharmony/arkcompiler/ets_runtime/bundle.json' does not exist in 'sub_component', 'modules', 'group_type', 'inner_kits', 'inner_api' or 'test'

[OHOS ERROR] [LOAD] Traceback (most recent call last):
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] [LOAD]     return func(*args, **kwargs)
[OHOS ERROR] [LOAD]            ^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/ohos_build_module.py", line 68, in run
[OHOS ERROR] [LOAD]     super().run()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/interface/build_module_interface.py", line 66, in run
[OHOS ERROR] [LOAD]     self._load()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/modules/ohos_build_module.py", line 100, in _load
[OHOS ERROR] [LOAD]     self.loader.run()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/services/interface/load_interface.py", line 50, in run
[OHOS ERROR] [LOAD]     self.__post_init__()
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/services/loader.py", line 131, in __post_init__
[OHOS ERROR] [LOAD]     self.parts_config_info = load_ohos_build.get_parts_info(
[OHOS ERROR] [LOAD]                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 963, in get_parts_info
[OHOS ERROR] [LOAD]     _output_parts_info(parts_config_dict,
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 779, in _output_parts_info
[OHOS ERROR] [LOAD]     check_subsystem_and_component(parts_info_output_path, skip_partlist_check)
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 702, in check_subsystem_and_component
[OHOS ERROR] [LOAD]     compare_subsystem_and_component(subsystem_name, components_name, subsystem_components_whitelist_info,
[OHOS ERROR] [LOAD]   File "/home/wkp/workspace/openharmony/build/hb/util/loader/load_ohos_build.py", line 668, in compare_subsystem_and_component
[OHOS ERROR] [LOAD]     raise Exception(message)
[OHOS ERROR] [LOAD] Exception: find component taihe_ffi_gen failed, please check it in /home/wkp/workspace/openharmony/out/preloader/rk3568/parts.json.
[OHOS ERROR] [LOAD]

[OHOS ERROR] [LOAD] Code:        0000
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Reason:      find component taihe_ffi_gen failed, please check it in /home/wkp/workspace/openharmony/out/preloader/rk3568/parts.json.
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Error Type:  UNKNOWN ERROR TYPE
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Description: NO DESCRIPTION
[OHOS ERROR] [LOAD]
[OHOS ERROR] [LOAD] Solution:    NO SOLUTION
[OHOS ERROR] [LOAD]
=====build  error=====
wkp@flashservers:~/workspace/openharmony$

### 【运行环境】

硬件:
ROM版本:
DevEvoStudio版本:
SDK版本:
[/md]




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