1e41f4b71Sopenharmony_ci# FAQs
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## Common Build Problems and Solutions
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci###  "usr/sbin/ninja: invalid option -- w"
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "usr/sbin/ninja: invalid option -- w" is displayed.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci- **Possible Causes**<br>The Ninja version in use does not support the **--w** option.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci- **Solution**<br>Uninstall Ninja and GN, and [install Ninja and GN of the required version](../../device-dev/get-code/gettools-ide.md).
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci### "/usr/bin/ld: cannot find -lncurses"
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "/usr/bin/ld: cannot find -lncurses" is displayed.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci- **Possible Causes**<br>The ncurses library is not available.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci- **Solution**<br>
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci  ```shell
22e41f4b71Sopenharmony_ci  sudo apt-get install lib32ncurses5-dev
23e41f4b71Sopenharmony_ci  ```
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci### "line 77: mcopy: command not found"
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "line 77: mcopy: command not found" is displayed.
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci- **Possible Causes**<br>mcopy is not available.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci- **Solution**<br>
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci  ```shell
34e41f4b71Sopenharmony_ci  sudo apt-get install dosfstools mtools
35e41f4b71Sopenharmony_ci  ```
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci### "riscv32-unknown-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory"
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "riscv32-unknown-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory" is displayed.
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci- **Possible Causes**<br>You do not have the permission to access files in the RISC-V compiler directory.
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci- **Solution**<br>1. Run the following command to locate **gcc_riscv32**.
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci  ```shell
46e41f4b71Sopenharmony_ci  which riscv32-unknown-elf-gcc
47e41f4b71Sopenharmony_ci  ```
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci  2. Run the **chmod** command to change the permission for the directory to **755**.
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci### "No module named 'Crypto'"
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "No module named'Crypto'" is displayed.
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ci- **Possible Causes**<br>Crypto is not installed in Python3.
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci- **Solution**<br>
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci  1. Run the following command to query the Python version:
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci     ```shell
62e41f4b71Sopenharmony_ci     python3 --version
63e41f4b71Sopenharmony_ci     ```
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ci  2. Ensure that Python 3.9.2 or later is installed, and then run the following command to install PyCryptodome:
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci     ```shell
68e41f4b71Sopenharmony_ci     sudo pip3 install pycryptodome
69e41f4b71Sopenharmony_ci     ```
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci### "xx.sh: xx unexpected operator"
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and " xx.sh [: xx unexpected operator" is displayed.
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci- **Possible Causes**<br>The build environment shell is not bash.
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ci- **Solution**<br>
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci  ```shell
80e41f4b71Sopenharmony_ci  sudo rm -rf /bin/sh
81e41f4b71Sopenharmony_ci  sudo ln -s /bin/bash /bin/sh
82e41f4b71Sopenharmony_ci  ```
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci
85e41f4b71Sopenharmony_ci### "some services are not authenticated. Listed as follow"
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and " some services are not authenticated. Listed as follow" is displayed.
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci- **Possible Causes**<br>In the .cfg file of the processes listed in the error message, **uid** is set to **root** or **system**. However, these processes are not high-privilege processes defined by the product.
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci- **Solution**<br>
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ci  Modify the process .cfg file to reduce the privilege level. Do not set **uid** to **root** or **system** unless necessary.
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci  If a process must have the **root** or **system** privilege due to service requirements, modify the **high_privilege_process_list.json** file with the approval of the security experts. The **high_privilege_process_list.json** file is located in **vendor/***{company_name}/{product_name }***/security_config**.
96e41f4b71Sopenharmony_ci
97e41f4b71Sopenharmony_ci  For example, the file for rk3586 is **//vendor/hihope/rk3568/security_config/high_privilege_process_list.json**.
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci
100e41f4b71Sopenharmony_ci### "Error: some services do not match with critical whitelist"
101e41f4b71Sopenharmony_ci
102e41f4b71Sopenharmony_ci- **Symptom**<br>The build fails, and "Error: some services do not match with critical whitelist" is displayed.
103e41f4b71Sopenharmony_ci
104e41f4b71Sopenharmony_ci- **Possible Causes**<br>In the .cfg file of the processes listed in the error message, the **critical** field is defined and enabled. However, the **critical** field is not allowed for the processes, or the **critical** setting does not match the settings in the whitelist.
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_ci- **Solution**<br>
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ci     Remove the **critical** field or set the first bit of the **critical** field to **0** in the .cfg file of the processes. Do not enable the **critical** field unless necessary.
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ci     For details about how to use the **critical** field, see [Service Management](subsys-boot-init-service.md). If **critical** needs to be enabled for a process due to service requirements, modify the **//vendor/{company_name}/{product_name}/security_config/critical_reboot_process_list.json** file with the approval of the security experts.
111e41f4b71Sopenharmony_ci
112e41f4b71Sopenharmony_ci     For example, the critical_reboot process control whitelist of rk3586 is **//vendor/hihope/rk3568/security_config/critical_reboot_process_list.json**.
113