报错Description: Ninja build error. The ninja build system cannot find the target.如何解决?

报错Description: Ninja build error. The ninja build system cannot find the target.如何解决。

[OHOS INFO] Excuting ninja command: /home/suo/oh4/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/suo/oh4/out/rk3588 images

[OHOS ERROR] ninja: error: '../../drivers/peripheral/camera/vdi_base/v4l2/src/camera_dump.cpp', needed by 'obj/drivers/peripheral/camera/vdi_base/v4l2/src/camera_host_vdi_impl_1.0/camera_dump.o', missing and no known rule to make it

[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/suo/oh4/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] return func(*args, **kwargs)
[OHOS ERROR] File "/home/suo/oh4/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/suo/oh4/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR] super().run()
[OHOS ERROR] File "/home/suo/oh4/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/suo/oh4/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR] self._target_compilation()
[OHOS ERROR] File "/home/suo/oh4/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR] self.target_compiler.run()
[OHOS ERROR] File "/home/suo/oh4/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR] self._execute_ninja_cmd()
[OHOS ERROR] File "/home/suo/oh4/build/hb/services/ninja.py", line 69, in _execute_ninja_cmd
[OHOS ERROR] SystemUtil.exec_command(
[OHOS ERROR] File "/home/suo/oh4/build/hb/util/system_util.py", line 64, in exec_command
[OHOS ERROR] LogUtil.get_failed_log(log_path)
[OHOS ERROR] File "/home/suo/oh4/build/hb/util/log_util.py", line 192, in get_failed_log
[OHOS ERROR] LogUtil.get_ninja_failed_log(log_path)
[OHOS ERROR] File "/home/suo/oh4/build/hb/util/log_util.py", line 157, in get_ninja_failed_log
[OHOS ERROR] raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: NINJA Failed! Please check error in /home/suo/oh4/out/rk3588/error.log, and for more build information in /home/suo/oh4/out/rk3588/build.log
[OHOS ERROR]

[OHOS ERROR] Code: 4016
[OHOS ERROR]
[OHOS ERROR] Reason: NINJA Failed! Please check error in /home/suo/oh4/out/rk3588/error.log, and for more build information in /home/suo/oh4/out/rk3588/build.log
[OHOS ERROR]
[OHOS ERROR] Error Type: ninja build error: missing and no known rule to make it
[OHOS ERROR]
[OHOS ERROR] Description: Ninja build error. The ninja build system cannot find the target.
[OHOS ERROR]
[OHOS ERROR] Solution: Please check the target file is exists.
[OHOS ERROR]
阅读 1.4k
1 个回答

这个是构建脚本的问题,需要贴出脚本来看具体哪个地方的配置问题。
下面是GN的构建流程:
image.png

log看是camera_dump.cpp编译失败,可以针对性看看对于camera_dump.cpp的配置。

关于GN的构建工具链可以参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进