• Lv3
    粉丝0

积分10 / 贡献0

提问1答案被采纳0文章0

作者动态

    RK3588 OpenHarmony5.0.0编译报错

    dashuailiu 显示全部楼层 发表于 3 天前

    【问题描述】

    1. 介绍问题现象和发生的背景

      ERROR at //third_party/selinux/BUILD.gn:46:5 (//build/toolchain/linux:clang_x64): Script returned non-zero exit code.
      
          exec_script("/usr/bin/flex",
      
          ^----------
      
      Current dir: /home/oo/out/sdk/
      
      Command: /usr/bin/env /usr/bin/flex -o /home/oo/third_party/selinux/libsepol/cil/src/cil_lexer.c /home/oo/third_party/selinux/libsepol/cil/src/cil_lexer.l
      
      Returned 127.
      
      stderr:
      
      /usr/bin/env: ‘/usr/bin/flex’: No such file or directory
      
      See //build/ohos/sdk/sdk.gni:196:27: which caused the file to be included.
      
              _sdk_modules += [ "${_target_label}(${invoker.sdk_toolchain})" ]
      
                                ^-------------------------------------------
    2. 相关的代码(请勿使用截图)

    3. 运行结果、错误截图

    4. [OHOS ERROR] ERROR at //third_party/selinux/BUILD.gn:46:5 (//build/toolchain/linux:clang_x64): Script returned non-zero exit code.

      [OHOS ERROR] exec_script("/usr/bin/flex",

      [OHOS ERROR] ^----------

      [OHOS ERROR] Current dir: /home/oo/out/sdk/

      [OHOS ERROR] Command: /usr/bin/env /usr/bin/flex -o /home/oo/third_party/selinux/libsepol/cil/src/cil_lexer.c /home/oo/third_party/selinux/libsepol/cil/src/cil_lexer.l

      [OHOS ERROR] Returned 127.

      [OHOS ERROR] stderr:

      [OHOS ERROR]

      [OHOS ERROR] /usr/bin/env: ‘/usr/bin/flex’: No such file or directory

      [OHOS ERROR]

      [OHOS ERROR] See //build/ohos/sdk/sdk.gni:196:27: which caused the file to be included.

      [OHOS ERROR] _sdk_modules += [ "${_target_label}(${invoker.sdk_toolchain})" ]

      [OHOS ERROR] ^-------------------------------------------

      [OHOS ERROR] Traceback (most recent call last): [OHOS ERROR] File "/home/oo/build/hb/containers/status.py", line 47, in wrapper [OHOS ERROR] return func(*args, **kwargs) [OHOS ERROR] ^^^^^^^^^^^^^^^^^^^^^ [OHOS ERROR] File "/home/oo/build/hb/services/gn.py", line 128, in _execute_gn_gen_cmd [OHOS ERROR] SystemUtil.exec_command(gn_gen_cmd, self.config.log_path) [OHOS ERROR] File "/home/oo/build/hb/util/system_util.py", line 75, in exec_command [OHOS ERROR] LogUtil.get_failed_log(log_path) [OHOS ERROR] File "/home/oo/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/oo/build/hb/util/log_util.py", line 137, in get_gn_failed_log [OHOS ERROR] raise OHOSException( [OHOS ERROR] exceptions.ohos_exception.OHOSException: GN Failed! Please check error in /home/oo/out/sdk/error.log, and for more build information in /home/oo/out/sdk/build.log [OHOS ERROR]

      [OHOS ERROR] Code: 3007 [OHOS ERROR] [OHOS ERROR] Reason: GN Failed! Please check error in /home/oo/out/sdk/error.log, and for more build information in /home/oo/out/sdk/build.log [OHOS ERROR] [OHOS ERROR] Error Type: GN build error: No such file or directory [OHOS ERROR] [OHOS ERROR] Description: GN build error. The GN build system cannot find the file. [OHOS ERROR] [OHOS ERROR] Solution: Please check whether the file exists. [OHOS ERROR] [OHOS ERROR] ohos-sdk build failed! You can try to use '--no-prebuilt-sdk' to skip the build of ohos-sdk.

    5. 我尝试过的解决方法和结果

    6. 我想要达到的结果

    【运行环境】

    硬件:rk3568 ROM版本: DevEvoStudio版本: SDK版本:5.0release

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    精彩评论1

    onefan

    沙发 发表于 3 天前
    应该是sdk的代码下载不全,sdk编译失败了。你试试--no-prebuilt-sdk不编译sdk,但是这个可能报其他的错。
    建议使用
    repo sync -c -j96
    repo forall -c 'git lfs pull'
    执行下:bash build/prebuilts_download.sh --skip-ssl
    再编译

    Copyright   ©2025  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部