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
10.88 K
1.57 K
下载
a small build system with a focus on speed
最近提交(Master分支:2 个月前 )
dcefb838 Fix typo: Explaantions -> Explanations 5 个月前
2f19d3a0 - 5 个月前
Logo

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

更多推荐