Android 源码编译失败:

/bin/bash: m4: command not found
[  0% 11/59985] Lex: checkpolicy <= external/selinux/checkpolicy/policy_scan.l
FAILED: out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_scan.c 
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_scan.c external/selinux/checkpolicy/policy_scan.l"
flex-2.5.39:??????,exec of /usr/bin/m4 failed
[  0% 12/59985] Yacc: checkpolicy <= external/selinux/checkpolicy/policy_parse.y
FAILED: out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c 
/bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d -v --defines=out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.h -o out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c external/selinux/checkpolicy/policy_parse.y"
[  0% 17/59985] Export includes file:  -- out/target/product/generic/obj/SHARED_LIBRARIES/libz_intermediates/export_includes
ninja: build stopped: subcommand failed.
19:37:35 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/mi/Android/Source'

遇见这个最后的报错的时候,注意向上看看base输出。

这就是问题所在,比如我的:/bin/bash: m4: command not found 

然后  下载这个指令就可以了:sudo apt-get install m4

然后重新make,继续执行就可以了。

GitHub 加速计划 / ni / ninja
5
0
下载
a small build system with a focus on speed
最近提交(Master分支:19 天前 )
47ed2d24 Bump actions/checkout from 4 to 5 10 天前
2e719411 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 20 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐