1.应用编译问题
解决方法:这个问题是编译所用nodejs不完整,重新同步或者删除重新拉取app编译模块nodejs
2.编译到openssl后报错:
[OHOS ERROR] ERROR at //build/config/BUILDCONFIG.gn:1039:5: Duplicate object file [OHOS ERROR] target(_target_type, target_name) { [OHOS ERROR] ^---------------------------------- [OHOS ERROR] The target //drivers/peripheral/audio/hdi_service/supportlibs:audio_render_adapter [OHOS ERROR] generates two object files with the same name: [OHOS ERROR] obj/device/board/opc/opi5plus/audio_alsa/audio_render_adapter/vendor_render.o [OHOS ERROR] [OHOS ERROR] It could be you accidentally have a file listed twice in the [OHOS ERROR] sources. Or, depending on how your toolchain maps sources to [OHOS ERROR] object files, two source files with the same name in different [OHOS ERROR] directories could map to the same object file. [OHOS ERROR] [OHOS ERROR] In the latter case, either rename one of the files or move one of [OHOS ERROR] the sources to a separate source_set to avoid them both being in [OHOS ERROR] the same target. [OHOS ERROR] cmd ['/home/zhou/openharmony/third_party/openssl/make_openssl_build_all_generated.sh', '/home/zhou/openharmony/third_party/openssl', '/home/zhou/openharmony/out/opi5plus/obj/third_party/openssl/build_all_generated', 'linux-aarch64'] start [OHOS ERROR] result.returncode = 0 [OHOS ERROR] result.stdout = /home/zhou/openharmony/out/opi5plus [OHOS ERROR] ~/openharmony/out/opi5plus/obj/third_party/openssl/build_all_generated/linux-aarch64 ~/openharmony/out/opi5plus [OHOS ERROR] /home/zhou/openharmony/third_party/openssl/Configure linux-aarch64 no-shared no-module no-filenames [OHOS ERROR] Configuring OpenSSL version 3.0.9 for target linux-aarch64 [OHOS ERROR] Using os-specific seed configuration [OHOS ERROR] Created configdata.pm [OHOS ERROR] Running configdata.pm [OHOS ERROR] Created Makefile.in [OHOS ERROR] Created Makefile [OHOS ERROR] Created include/openssl/configuration.h [OHOS ERROR] [OHOS ERROR] ********************************************************************** [OHOS ERROR] *** *** [OHOS ERROR] *** OpenSSL has been successfully configured *** [OHOS ERROR] *** *** [OHOS ERROR] *** If you encounter a problem while building, please open an *** [OHOS ERROR] *** issue on GitHub <https://github.com/openssl/openssl/issues> *** [OHOS ERROR] *** and include the output from the following command: *** [OHOS ERROR] *** *** [OHOS ERROR] *** perl configdata.pm --dump *** [OHOS ERROR] *** *** [OHOS ERROR] *** (If you are new to OpenSSL, you might want to consult the *** [OHOS ERROR] *** 'Troubleshooting' section in the INSTALL.md file first) *** [OHOS ERROR] *** *** [OHOS ERROR] ********************************************************************** [OHOS ERROR] ~/openharmony/out/opi5plus [OHOS ERROR] [OHOS ERROR] cmd ['/home/zhou/openharmony/third_party/openssl/make_openssl_build_all_generated.sh', '/home/zhou/openharmony/third_party/openssl', '/home/zhou/openharmony/out/opi5plus/obj/third_party/openssl/build_all_generated', 'linux-aarch64'] ok [OHOS ERROR] [OHOS ERROR] cmd ['/home/zhou/openharmony/third_party/openssl/make_openssl_build_all_generated.sh', '/home/zhou/openharmony/third_party/openssl', '/home/zhou/openharmony/out/opi5plus/clang_x64/obj/third_party/openssl/build_all_generated', 'linux-x86_64'] start [OHOS ERROR] result.returncode = 0 [OHOS ERROR] result.stdout = /home/zhou/openharmony/out/opi5plus [OHOS ERROR] ~/openharmony/out/opi5plus/clang_x64/obj/third_party/openssl/build_all_generated/linux-x86_64 ~/openharmony/out/opi5plus [OHOS ERROR] Traceback (most recent call last): [OHOS ERROR] File "/home/zhou/openharmony/build/hb/containers/status.py", line 47, in wrapper [OHOS ERROR] return func(*args, **kwargs) [OHOS ERROR] ^^^^^^^^^^^^^^^^^^^^^ [OHOS ERROR] File "/home/zhou/openharmony/build/hb/services/gn.py", line 128, in executegn_gen_cmd [OHOS ERROR] SystemUtil.exec_command(gn_gen_cmd, self.config.log_path) [OHOS ERROR] File "/home/zhou/openharmony/build/hb/util/system_util.py", line 75, in exec_command [OHOS ERROR] LogUtil.get_failed_log(log_path) [OHOS ERROR] File "/home/zhou/openharmony/build/hb/util/log_util.py", line 191, in get_failed_log [OHOS ERROR] LogUtil.get_gn_failed_log(log_path) [OHOS ERROR] File "/home/zhou/openharmony/build/hb/util/log_util.py", line 137, in get_gn_failed_log
这个是因为在 //build/config/BUILDCONFIG.gn
文件的第 1039 行发现了一个问题:目标 //drivers/peripheral/audio/hdi_service/supportlibs:audio_render_adapter
生成了两个同名对象文件 vendor_render.o
。
重新拉取最新代码,清除旧编译并重新编译的解决策略如下:
从主分支拉取最新代码;
清除旧的编译文件;
重新进行编译。
3.烧录后无法开机
因为目前只支持烧录到emmc存储,烧录到sd卡和nvme硬盘会导致无法开机
4.编译5.0.0时会有一个报错但5.0.3不会
编译5.0.0报错:[OHOS ERROR] ../../base/startup/appspawn/modules/common/appspawn_adapter.cpp:64:21: error: unused function 'SetSelinuxConNweb' [-Werror,-Wunused-function]
解决方法:
cd $PROJ_ROOT
OpenHarmony 64bit系统编译问题,补丁修复统一使用x86补丁
cd vendor/opc/x86_general/patches
sh patch.sh
#香橙派5Plus
./build.sh --product-name opi5plus --ccache
#FILY F12
./build.sh --product-name f12 --ccache
#X86 general
./build.sh --product-name x86_general --ccache