Tag Archives: openharmony

Ubuntu22.04 OpenHarmony Execute hb set Error [How to Solve]

Error message

Recently using Ubuntu22.04 to build OpenHarmony compilation environment, When executing the hb set command to select the development board, the following error appears:
Insert picture description here
The detailed log is as follows:

fangye@fangye-virtual-machine:~/niobeu4_src$ hb set
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/fangye/.local/lib/python3.10/site-packages/hb/__main__.py", line 84, in main
[OHOS ERROR] status = args.command(args)
[OHOS ERROR] File "/home/fangye/niobeu4_src/build/lite/hb_internal/set/set.py", line 45, in exec_command
[OHOS ERROR] return set_product() == 0
[OHOS ERROR] File "/home/fangye/niobeu4_src/build/lite/hb_internal/set/set.py", line 62, in set_product
[OHOS ERROR] product_info = Product.product_menuconfig()
[OHOS ERROR] File "/home/fangye/niobeu4_src/build/lite/hb_internal/common/product.py", line 260, in product_menuconfig
[OHOS ERROR] product = menu.list_promt('product', 'Which product do you need" alt="" />

 

Solution:

Modify the python script reported error: modify from collections import Mapping tofrom collections.abc import Mapping:

vim ~/.local/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py

在这里插入图片描述

hb set Error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor (openharmony Compile ubuntu20.04 official document)

ubuntu20.04 hb set error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor

Compilation error

View environment

View version

Try to delete the ohos_config.json file in the project root directory, and then execute the “hb set” command, it still reports an error

Solution:

Uninstall this one: pip3 uninstall ohos-build
and then execute three lines of code in the source code path

 pythom3 -m  pip install build/lite

 pythom3 -m  pip install ohos-build 

pip3 install build/lite